Changed the model
#1
by
GiovannaMariotto
- opened
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
@@ -38,12 +39,22 @@ final_answer = FinalAnswerTool()
|
|
| 38 |
|
| 39 |
# 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:
|
| 40 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
)
|
| 48 |
|
| 49 |
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
+
from smolagents import InferenceClientModel # instead of HfApiModel
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
|
|
| 39 |
|
| 40 |
# 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:
|
| 41 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 42 |
+
# model = InferenceClientModel(model="google/flan-t5-xl") # or try "flan-t5-base" if you want faster speed
|
| 43 |
|
| 44 |
+
## Model require credits
|
| 45 |
+
#model = HfApiModel(
|
| 46 |
+
#max_tokens=2096,
|
| 47 |
+
#temperature=0.5,
|
| 48 |
+
#model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 49 |
+
#custom_role_conversions=None,
|
| 50 |
+
#)
|
| 51 |
+
|
| 52 |
+
from smolagents import InferenceClientModel # instead of HfApiModel
|
| 53 |
+
|
| 54 |
+
model = InferenceClientModel(
|
| 55 |
+
model="google/flan-t5-xl", # Free-tier, no credits required
|
| 56 |
+
max_tokens=512,
|
| 57 |
+
temperature=0.5,
|
| 58 |
)
|
| 59 |
|
| 60 |
|