Update app.py
Browse files
app.py
CHANGED
|
@@ -6,19 +6,20 @@ import pandas as pd
|
|
| 6 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, VisitWebpageTool
|
| 7 |
from smolagents.models import InferenceClientModel
|
| 8 |
|
| 9 |
-
|
| 10 |
|
| 11 |
-
def
|
| 12 |
return InferenceClientModel(
|
| 13 |
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 14 |
-
provider="
|
| 15 |
-
|
| 16 |
temperature=0.2,
|
| 17 |
max_tokens=8192,
|
| 18 |
timeout=120,
|
| 19 |
)
|
| 20 |
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 24 |
|
|
|
|
| 6 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, VisitWebpageTool
|
| 7 |
from smolagents.models import InferenceClientModel
|
| 8 |
|
| 9 |
+
HF_API_TOKEN = os.getenv("HF_TOKEN")
|
| 10 |
|
| 11 |
+
def get_hf_model():
|
| 12 |
return InferenceClientModel(
|
| 13 |
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 14 |
+
# provider="auto", # You can omit this, 'auto' is the default
|
| 15 |
+
token=HF_API_TOKEN, # Use 'token' instead of 'api_key'
|
| 16 |
temperature=0.2,
|
| 17 |
max_tokens=8192,
|
| 18 |
timeout=120,
|
| 19 |
)
|
| 20 |
|
| 21 |
+
# Make sure to update this line too
|
| 22 |
+
MODEL = get_hf_model()
|
| 23 |
|
| 24 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 25 |
|