Change authentication
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 |
from typing import List
|
| 8 |
|
|
@@ -42,6 +43,7 @@ final_answer = FinalAnswerTool()
|
|
| 42 |
|
| 43 |
# 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:
|
| 44 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
|
| 45 |
|
| 46 |
model = HfApiModel(
|
| 47 |
max_tokens=2096,
|
|
@@ -49,6 +51,7 @@ temperature=0.5,
|
|
| 49 |
#model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
|
| 50 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 51 |
custom_role_conversions=None,
|
|
|
|
| 52 |
)
|
| 53 |
|
| 54 |
|
|
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
+
import os
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
from typing import List
|
| 9 |
|
|
|
|
| 43 |
|
| 44 |
# 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:
|
| 45 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 46 |
+
access_token = os.getenv('HUGGINGFACE_TOKEN')
|
| 47 |
|
| 48 |
model = HfApiModel(
|
| 49 |
max_tokens=2096,
|
|
|
|
| 51 |
#model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
|
| 52 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 53 |
custom_role_conversions=None,
|
| 54 |
+
token=access_token,
|
| 55 |
)
|
| 56 |
|
| 57 |
|