Spaces:
Sleeping
Sleeping
smolLM
Browse files- app.py +13 -7
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -12,6 +12,8 @@ from dotenv import load_dotenv
|
|
| 12 |
from tools.final_answer import FinalAnswerTool
|
| 13 |
from tools.weather import WeatherTool
|
| 14 |
from tools.web_search import DuckDuckGoSearchTool
|
|
|
|
|
|
|
| 15 |
|
| 16 |
from Gradio_UI import GradioUI
|
| 17 |
|
|
@@ -53,13 +55,17 @@ web_search = DuckDuckGoSearchTool()
|
|
| 53 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 54 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 55 |
|
| 56 |
-
model = HfApiModel(
|
| 57 |
-
max_tokens=2096,
|
| 58 |
-
temperature=0.5,
|
| 59 |
-
model_id
|
| 60 |
-
#
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
|
| 65 |
# Import tool from Hub
|
|
|
|
| 12 |
from tools.final_answer import FinalAnswerTool
|
| 13 |
from tools.weather import WeatherTool
|
| 14 |
from tools.web_search import DuckDuckGoSearchTool
|
| 15 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 16 |
+
|
| 17 |
|
| 18 |
from Gradio_UI import GradioUI
|
| 19 |
|
|
|
|
| 55 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 56 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 57 |
|
| 58 |
+
# model = HfApiModel(
|
| 59 |
+
# max_tokens=2096,
|
| 60 |
+
# temperature=0.5,
|
| 61 |
+
# # model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 62 |
+
# custom_role_conversions=None,
|
| 63 |
+
# )
|
| 64 |
+
|
| 65 |
+
checkpoint = "HuggingFaceTB/SmolLM3-3B"
|
| 66 |
+
|
| 67 |
+
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
| 68 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint)
|
| 69 |
|
| 70 |
|
| 71 |
# Import tool from Hub
|
requirements.txt
CHANGED
|
@@ -3,3 +3,4 @@ smolagents==1.13.0
|
|
| 3 |
requests
|
| 4 |
duckduckgo_search
|
| 5 |
pandas
|
|
|
|
|
|
| 3 |
requests
|
| 4 |
duckduckgo_search
|
| 5 |
pandas
|
| 6 |
+
transformers
|