Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
6 |
from datetime import datetime
|
7 |
from pathlib import Path
|
8 |
from typing import List, Optional
|
|
|
9 |
|
10 |
import datasets
|
11 |
import pandas as pd
|
@@ -36,14 +37,12 @@ from smolagents import (
|
|
36 |
HfApiModel,
|
37 |
LiteLLMModel,
|
38 |
Model,
|
39 |
-
|
|
|
40 |
)
|
41 |
from smolagents.agent_types import AgentText, AgentImage, AgentAudio
|
42 |
from smolagents.gradio_ui import pull_messages_from_step, handle_agent_output_types
|
43 |
|
44 |
-
from smolagents import Tool
|
45 |
-
|
46 |
-
from urllib import parse
|
47 |
|
48 |
WOLFRAM_RESPONSE_KEYS = [
|
49 |
"Result",
|
@@ -289,7 +288,7 @@ def stream_to_gradio(
|
|
289 |
class GradioUI:
|
290 |
"""A one-line interface to launch your agent in Gradio"""
|
291 |
|
292 |
-
def __init__(self, file_upload_folder: str | None =
|
293 |
|
294 |
self.file_upload_folder = file_upload_folder
|
295 |
if self.file_upload_folder is not None:
|
|
|
6 |
from datetime import datetime
|
7 |
from pathlib import Path
|
8 |
from typing import List, Optional
|
9 |
+
from urllib import parse
|
10 |
|
11 |
import datasets
|
12 |
import pandas as pd
|
|
|
37 |
HfApiModel,
|
38 |
LiteLLMModel,
|
39 |
Model,
|
40 |
+
load_tool,
|
41 |
+
Tool,
|
42 |
)
|
43 |
from smolagents.agent_types import AgentText, AgentImage, AgentAudio
|
44 |
from smolagents.gradio_ui import pull_messages_from_step, handle_agent_output_types
|
45 |
|
|
|
|
|
|
|
46 |
|
47 |
WOLFRAM_RESPONSE_KEYS = [
|
48 |
"Result",
|
|
|
288 |
class GradioUI:
|
289 |
"""A one-line interface to launch your agent in Gradio"""
|
290 |
|
291 |
+
def __init__(self, file_upload_folder: str | None = "uploads"):
|
292 |
|
293 |
self.file_upload_folder = file_upload_folder
|
294 |
if self.file_upload_folder is not None:
|