Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,14 @@ import inspect
|
|
| 5 |
import pandas as pd
|
| 6 |
from smolagents import CodeAgent, HfApiModel
|
| 7 |
from smolagents.tools import PythonInterpreterTool, DuckDuckGoSearchTool
|
|
|
|
|
|
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# --- Constants ---
|
| 10 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 11 |
|
|
|
|
| 5 |
import pandas as pd
|
| 6 |
from smolagents import CodeAgent, HfApiModel
|
| 7 |
from smolagents.tools import PythonInterpreterTool, DuckDuckGoSearchTool
|
| 8 |
+
import subprocess
|
| 9 |
+
import sys
|
| 10 |
|
| 11 |
+
def install_package(package):
|
| 12 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
| 13 |
+
|
| 14 |
+
# 使用示例
|
| 15 |
+
install_package("smolagents")
|
| 16 |
# --- Constants ---
|
| 17 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 18 |
|