Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from huggingface_hub import login
|
|
10 |
#h
|
11 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
12 |
|
13 |
-
login(token=os.environ["HUGGINGFACEHUB_API_TOKEN"])
|
14 |
openai_key = os.environ.get("OPENAI_API_KEY")
|
15 |
|
16 |
search_tool = DuckDuckGoSearchTool()
|
@@ -118,7 +118,9 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
118 |
|
119 |
agent = ToolCallingAgent(
|
120 |
tools=[search_tool, yt_tool],
|
121 |
-
|
|
|
|
|
122 |
max_steps=12,
|
123 |
verbosity_level=2
|
124 |
)
|
@@ -135,7 +137,7 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
135 |
response.raise_for_status()
|
136 |
questions_data = response.json()
|
137 |
|
138 |
-
selected_indices = [0, 2, 4, 6, 10, 12, 14, 15, 16, 17] # Replace with the indices you want
|
139 |
questions_data = [questions_data[i] for i in selected_indices if i < len(questions_data)]
|
140 |
|
141 |
if not questions_data:
|
|
|
10 |
#h
|
11 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
12 |
|
13 |
+
#login(token=os.environ["HUGGINGFACEHUB_API_TOKEN"])
|
14 |
openai_key = os.environ.get("OPENAI_API_KEY")
|
15 |
|
16 |
search_tool = DuckDuckGoSearchTool()
|
|
|
118 |
|
119 |
agent = ToolCallingAgent(
|
120 |
tools=[search_tool, yt_tool],
|
121 |
+
model=OpenAIServerModel(model_id="gpt-4o-mini",
|
122 |
+
api_key=os.environ["OPENAI_API_KEY"],
|
123 |
+
temperature=0.0),
|
124 |
max_steps=12,
|
125 |
verbosity_level=2
|
126 |
)
|
|
|
137 |
response.raise_for_status()
|
138 |
questions_data = response.json()
|
139 |
|
140 |
+
selected_indices = [0, 2, 4, 6, 10, 12, 14, 15, 16, 17, 19] # Replace with the indices you want
|
141 |
questions_data = [questions_data[i] for i in selected_indices if i < len(questions_data)]
|
142 |
|
143 |
if not questions_data:
|