Spaces:
Sleeping
Sleeping
meirk-brd
commited on
Commit
·
702cacf
1
Parent(s):
0533344
Add HF_TOKEN support for model authentication
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from smolagents import CodeAgent
|
| 3 |
from smolagents.models import InferenceClientModel
|
|
@@ -12,7 +13,8 @@ dataset_tool = BrightDataDatasetTool()
|
|
| 12 |
|
| 13 |
# Initialize the agent with a Hugging Face Inference model
|
| 14 |
# Requires HF_TOKEN in the environment for authentication.
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
agent = CodeAgent(
|
| 18 |
tools=[scraper_tool, search_tool, dataset_tool],
|
|
|
|
| 1 |
+
import os
|
| 2 |
import gradio as gr
|
| 3 |
from smolagents import CodeAgent
|
| 4 |
from smolagents.models import InferenceClientModel
|
|
|
|
| 13 |
|
| 14 |
# Initialize the agent with a Hugging Face Inference model
|
| 15 |
# Requires HF_TOKEN in the environment for authentication.
|
| 16 |
+
hf_token = os.getenv("HF_TOKEN")
|
| 17 |
+
model = InferenceClientModel(model_id="deepseek-ai/DeepSeek-V3.2", token=hf_token)
|
| 18 |
|
| 19 |
agent = CodeAgent(
|
| 20 |
tools=[scraper_tool, search_tool, dataset_tool],
|