Spaces:
Runtime error
Runtime error
Update app.py
#2
by Roman190928 - opened
app.py
CHANGED
|
@@ -44,7 +44,7 @@ from smolagents import (
|
|
| 44 |
ToolCallingAgent,
|
| 45 |
)
|
| 46 |
from smolagents.agent_types import AgentText, AgentImage, AgentAudio
|
| 47 |
-
from smolagents.gradio_ui import pull_messages_from_step
|
| 48 |
|
| 49 |
AUTHORIZED_IMPORTS = [
|
| 50 |
"requests",
|
|
@@ -71,6 +71,7 @@ AUTHORIZED_IMPORTS = [
|
|
| 71 |
"datetime",
|
| 72 |
"fractions",
|
| 73 |
"csv",
|
|
|
|
| 74 |
]
|
| 75 |
load_dotenv(override=True)
|
| 76 |
login(os.getenv("HF_TOKEN"))
|
|
@@ -167,7 +168,6 @@ def stream_to_gradio(
|
|
| 167 |
yield message
|
| 168 |
|
| 169 |
final_answer = step_log # Last log is the run's final_answer
|
| 170 |
-
final_answer = handle_agent_output_types(final_answer)
|
| 171 |
|
| 172 |
if isinstance(final_answer, AgentText):
|
| 173 |
yield gr.ChatMessage(
|
|
|
|
| 44 |
ToolCallingAgent,
|
| 45 |
)
|
| 46 |
from smolagents.agent_types import AgentText, AgentImage, AgentAudio
|
| 47 |
+
from smolagents.gradio_ui import pull_messages_from_step #agent type thing might not exist...
|
| 48 |
|
| 49 |
AUTHORIZED_IMPORTS = [
|
| 50 |
"requests",
|
|
|
|
| 71 |
"datetime",
|
| 72 |
"fractions",
|
| 73 |
"csv",
|
| 74 |
+
"re", #allow regex
|
| 75 |
]
|
| 76 |
load_dotenv(override=True)
|
| 77 |
login(os.getenv("HF_TOKEN"))
|
|
|
|
| 168 |
yield message
|
| 169 |
|
| 170 |
final_answer = step_log # Last log is the run's final_answer
|
|
|
|
| 171 |
|
| 172 |
if isinstance(final_answer, AgentText):
|
| 173 |
yield gr.ChatMessage(
|