Spaces:
Runtime error
Runtime error
Leonardo
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,44 +6,7 @@ import re
|
|
| 6 |
import shutil
|
| 7 |
from typing import Optional
|
| 8 |
|
| 9 |
-
from
|
| 10 |
-
from huggingface_hub import login
|
| 11 |
-
import gradio as gr
|
| 12 |
-
|
| 13 |
-
from scripts.text_inspector_tool import TextInspectorTool
|
| 14 |
-
from scripts.text_web_browser import (
|
| 15 |
-
ArchiveSearchTool,
|
| 16 |
-
FinderTool,
|
| 17 |
-
FindNextTool,
|
| 18 |
-
PageDownTool,
|
| 19 |
-
PageUpTool,
|
| 20 |
-
SimpleTextBrowser,
|
| 21 |
-
VisitTool,
|
| 22 |
-
)
|
| 23 |
-
from scripts.visual_qa import visualizer
|
| 24 |
-
|
| 25 |
-
from smolagents import (
|
| 26 |
-
CodeAgent,
|
| 27 |
-
HfApiModel,
|
| 28 |
-
LiteLLMModel,
|
| 29 |
-
OpenAIServerModel,
|
| 30 |
-
TransformersModel,
|
| 31 |
-
GoogleSearchTool,
|
| 32 |
-
Tool,
|
| 33 |
-
)
|
| 34 |
-
from smolagents.agent_types import AgentText, AgentImage, AgentAudio
|
| 35 |
-
from smolagents.gradio_ui import pull_messages_from_step, handle_agent_output_types
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
# Constants and configurations
|
| 39 |
-
"""Main application for the OpenDeepResearch Gradio interface."""
|
| 40 |
-
|
| 41 |
-
import mimetypes
|
| 42 |
-
import os
|
| 43 |
-
import re
|
| 44 |
-
import shutil
|
| 45 |
-
from typing import Optional
|
| 46 |
-
|
| 47 |
from dotenv import load_dotenv
|
| 48 |
from huggingface_hub import login
|
| 49 |
import gradio as gr
|
|
@@ -415,8 +378,6 @@ class GradioUI:
|
|
| 415 |
def log_user_message(self, text_input, file_uploads_log):
|
| 416 |
"""Process user message and handle file references."""
|
| 417 |
# Clean the user input using the TextCleanerTool
|
| 418 |
-
from cleantext import clean
|
| 419 |
-
|
| 420 |
cleaned_message = clean(
|
| 421 |
text_input,
|
| 422 |
fix_unicode=True,
|
|
|
|
| 6 |
import shutil
|
| 7 |
from typing import Optional
|
| 8 |
|
| 9 |
+
from cleantext import clean
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
from dotenv import load_dotenv
|
| 11 |
from huggingface_hub import login
|
| 12 |
import gradio as gr
|
|
|
|
| 378 |
def log_user_message(self, text_input, file_uploads_log):
|
| 379 |
"""Process user message and handle file references."""
|
| 380 |
# Clean the user input using the TextCleanerTool
|
|
|
|
|
|
|
| 381 |
cleaned_message = clean(
|
| 382 |
text_input,
|
| 383 |
fix_unicode=True,
|