From d9877811cdbbc34168e285cbf5c6a2bffe077465 Mon Sep 17 00:00:00 2001 From: Aymeric Date: Mon, 11 Nov 2024 19:22:42 +0100 Subject: [PATCH] Hopefully fix tests --- src/transformers/agents/monitoring.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/transformers/agents/monitoring.py b/src/transformers/agents/monitoring.py index 65ed3d79cfe6c9..b1cfd7414fbfa5 100644 --- a/src/transformers/agents/monitoring.py +++ b/src/transformers/agents/monitoring.py @@ -25,8 +25,9 @@ def pull_message(step_log: dict, test_mode: bool = True): if test_mode: class ChatMessage: - role: str - content: dict + def __init__(self, role, content): + self.role = role + self.content = content else: raise ImportError("Gradio should be installed in order to launch a gradio demo.") @@ -61,8 +62,9 @@ def stream_to_gradio(agent: ReactAgent, task: str, test_mode: bool = False, **kw if test_mode: class ChatMessage: - role: str - content: dict + def __init__(self, role, content): + self.role = role + self.content = content else: raise ImportError("Gradio should be installed in order to launch a gradio demo.")