diff --git a/pyproject.toml b/pyproject.toml index a7ae25c..3ae269c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ dependencies = [ "textual-serve==1.1.3", "typeguard==2.13", "pyperclip==1.11.0", + "torch==2.10.0", ] [project.optional-dependencies] diff --git a/src/vulcanai/console/utils.py b/src/vulcanai/console/utils.py index 1d00da9..aa80543 100644 --- a/src/vulcanai/console/utils.py +++ b/src/vulcanai/console/utils.py @@ -51,6 +51,7 @@ class StreamToTextual: def __init__(self, app, stream_name: str = "stdout"): self.app = app + self.stream_name = stream_name self.real_stream = getattr(sys, stream_name) def write(self, data: str): @@ -58,9 +59,8 @@ def write(self, data: str): return if data.strip(): - # Ensure update happens on the app thread - # self.app.call_from_thread(self.app.append_log_text, data) - self.app.call_from_thread(self.app.add_line, data) + color = "red" if self.stream_name == "stderr" else "" + self.app.call_from_thread(self.app.add_line, data, color) def flush(self): self.real_stream.flush()