Spaces:
Paused
Paused
Didier Guillevic commited on
Commit ·
bb1436b
1
Parent(s): 638e937
Changing large language model
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import datetime
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
|
|
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
|
| 8 |
# local import
|
|
@@ -40,6 +41,9 @@ final_answer = FinalAnswerTool()
|
|
| 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 |
|
|
|
|
|
|
|
|
|
|
| 43 |
model = smolagents.HfApiModel(
|
| 44 |
max_tokens=2096,
|
| 45 |
temperature=0.5,
|
|
@@ -49,6 +53,13 @@ model = smolagents.HfApiModel(
|
|
| 49 |
)
|
| 50 |
model = smolagents.HfApiModel()
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
# Import tool from Hub
|
| 54 |
image_generation_tool = smolagents.load_tool(
|
|
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
+
import os
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
|
| 9 |
# local import
|
|
|
|
| 41 |
# 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:
|
| 42 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 43 |
|
| 44 |
+
model_id = 'Qwen/Qwen2.5-Coder-32B-Instruct'
|
| 45 |
+
model_id = 'https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 46 |
+
|
| 47 |
model = smolagents.HfApiModel(
|
| 48 |
max_tokens=2096,
|
| 49 |
temperature=0.5,
|
|
|
|
| 53 |
)
|
| 54 |
model = smolagents.HfApiModel()
|
| 55 |
|
| 56 |
+
mistral_api_key = os.environ["MISTRAL_API_KEY"]
|
| 57 |
+
mistral_model_id = "mistral/codestral-latest"
|
| 58 |
+
model = smolagents.LiteLLMModel(
|
| 59 |
+
model_id=mistral_model_id,
|
| 60 |
+
api_key=mistral_api_key,
|
| 61 |
+
temperature=0.0
|
| 62 |
+
)
|
| 63 |
|
| 64 |
# Import tool from Hub
|
| 65 |
image_generation_tool = smolagents.load_tool(
|