Spaces:
Sleeping
Sleeping
Added app token that is read from the environment and the related requirement
Browse files- app.py +9 -1
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 2 |
import datetime
|
|
|
|
| 3 |
import pytz
|
| 4 |
import yaml
|
| 5 |
|
|
@@ -7,11 +8,17 @@ import pandas
|
|
| 7 |
|
| 8 |
from typing import List
|
| 9 |
|
|
|
|
| 10 |
from tools.final_answer import FinalAnswerTool
|
| 11 |
-
|
| 12 |
from Gradio_UI import GradioUI
|
| 13 |
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
@tool
|
| 16 |
def format_country_info(
|
| 17 |
population: int, languages: List[str], religions: List[str]
|
|
@@ -65,6 +72,7 @@ model = HfApiModel(
|
|
| 65 |
temperature=0.5,
|
| 66 |
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 67 |
custom_role_conversions=None,
|
|
|
|
| 68 |
)
|
| 69 |
|
| 70 |
|
|
|
|
| 1 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 2 |
import datetime
|
| 3 |
+
import os
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
|
|
|
|
| 8 |
|
| 9 |
from typing import List
|
| 10 |
|
| 11 |
+
from dotenv import load_dotenv
|
| 12 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
| 13 |
from Gradio_UI import GradioUI
|
| 14 |
|
| 15 |
|
| 16 |
+
load_dotenv()
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
HF_TOKEN = os.getenv("HF_U1ACAPP_TOKEN")
|
| 20 |
+
|
| 21 |
+
|
| 22 |
@tool
|
| 23 |
def format_country_info(
|
| 24 |
population: int, languages: List[str], religions: List[str]
|
|
|
|
| 72 |
temperature=0.5,
|
| 73 |
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 74 |
custom_role_conversions=None,
|
| 75 |
+
token=HF_TOKEN,
|
| 76 |
)
|
| 77 |
|
| 78 |
|
requirements.txt
CHANGED
|
@@ -3,4 +3,5 @@ smolagents
|
|
| 3 |
requests
|
| 4 |
duckduckgo_search
|
| 5 |
pandas
|
|
|
|
| 6 |
tabulate
|
|
|
|
| 3 |
requests
|
| 4 |
duckduckgo_search
|
| 5 |
pandas
|
| 6 |
+
python-dotenv
|
| 7 |
tabulate
|