Update app.py
Browse filesTrying huggingface login()
app.py
CHANGED
@@ -8,7 +8,8 @@ import datetime
|
|
8 |
import requests
|
9 |
import pytz
|
10 |
from tools.final_answer import FinalAnswerTool
|
11 |
-
import openai
|
|
|
12 |
|
13 |
# (Keep Constants as is)
|
14 |
# --- Constants ---
|
@@ -48,13 +49,14 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
48 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
49 |
try:
|
50 |
# agent = BasicAgent()
|
51 |
-
openai.api_key = os.getenv('my_key')
|
52 |
-
hf_token = os.getenv('hf_token')
|
|
|
53 |
model = HfApiModel(
|
54 |
max_tokens=2096,
|
55 |
temperature=0.5,
|
56 |
-
|
57 |
-
model_id='gpt-4o',
|
58 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
|
59 |
custom_role_conversions=None,
|
60 |
)
|
|
|
8 |
import requests
|
9 |
import pytz
|
10 |
from tools.final_answer import FinalAnswerTool
|
11 |
+
# import openai
|
12 |
+
from huggingface_hub import login
|
13 |
|
14 |
# (Keep Constants as is)
|
15 |
# --- Constants ---
|
|
|
49 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
50 |
try:
|
51 |
# agent = BasicAgent()
|
52 |
+
# openai.api_key = os.getenv('my_key')
|
53 |
+
# hf_token = os.getenv('hf_token')
|
54 |
+
login()
|
55 |
model = HfApiModel(
|
56 |
max_tokens=2096,
|
57 |
temperature=0.5,
|
58 |
+
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
59 |
+
# model_id='gpt-4o',
|
60 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
|
61 |
custom_role_conversions=None,
|
62 |
)
|