Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,21 +1,11 @@
|
|
| 1 |
-
|
| 2 |
import os
|
| 3 |
-
import
|
| 4 |
-
import
|
| 5 |
-
import
|
|
|
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
| 10 |
-
except ImportError:
|
| 11 |
-
print("⚠️ Installing smolagents from source...")
|
| 12 |
-
subprocess.check_call([sys.executable, "-m", "pip", "install", "git+https://github.com/huggingface/smolagents.git"])
|
| 13 |
-
|
| 14 |
-
# 💡 CRITICAL STEP: Force Python to reload the module we just installed
|
| 15 |
-
import smolagents
|
| 16 |
-
importlib.reload(smolagents)
|
| 17 |
-
|
| 18 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
| 19 |
import gradio as gr
|
| 20 |
import requests
|
| 21 |
import pandas as pd
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
import gradio as gr
|
| 3 |
+
import requests
|
| 4 |
+
import pandas as pd
|
| 5 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
| 6 |
|
| 7 |
+
# --- Constants ---
|
| 8 |
+
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
import gradio as gr
|
| 10 |
import requests
|
| 11 |
import pandas as pd
|