Spaces:
Sleeping
Sleeping
Update app.py
Browse files123456456789101112131415161718192021222324825262728import osimport gradio as grimport requestsimport pandas as pd # You might not need this if smolagents handles data# import subprocess # REMOVE if using smolagents, this was for the previous workaround# import sys # REMOVE if using smolagents, this was for the previous workaroundimport pandas as pdimport subprocessimport sys # Import sys
# --- START: Force DDGS installation workaround ---try: # Check if duckduckgo_search (provided by ddgs) can be imported import duckduckgo_search print("duckduckgo_search (via ddgs) is already installed.")except ImportError: print("duckduckgo_search not found. Attempting to install ddgs...") try: # Use ddgs as it's the updated package name subprocess.check_call([sys.executable, "-m", "pip", "install", "ddgs>=4.0.0"]) print("ddgs installed successfully.") except Exception as e: print(f"Failed to install ddgs: {e}") # Critical error, re-raise to stop startup if essential dependency fails raise RuntimeError(f"CRITICAL: Failed to install ddgs: {e}")# --- END: Force DDGS installation workaround ---
from agent import GaiaAgentfrom agent import GaiaAgent # This line should now run after ddgs is confirmed installed
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
app.py+21-4