Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,6 +13,12 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 13 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 14 |
class BasicAgent:
|
| 15 |
def __init__(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
print("BasicAgent initialized.")
|
| 17 |
def __call__(self, question: str) -> str:
|
| 18 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
|
@@ -21,12 +27,7 @@ class BasicAgent:
|
|
| 21 |
return fixed_answer
|
| 22 |
|
| 23 |
|
| 24 |
-
|
| 25 |
-
max_tokens=2096,
|
| 26 |
-
temperature=0.5,
|
| 27 |
-
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 28 |
-
custom_role_conversions=None,
|
| 29 |
-
)
|
| 30 |
|
| 31 |
|
| 32 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
@@ -202,17 +203,6 @@ if __name__ == "__main__":
|
|
| 202 |
|
| 203 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
| 204 |
|
| 205 |
-
|
| 206 |
-
model=model,
|
| 207 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 208 |
-
max_steps=6,
|
| 209 |
-
verbosity_level=1,
|
| 210 |
-
grammar=None,
|
| 211 |
-
planning_interval=None,
|
| 212 |
-
name=None,
|
| 213 |
-
description=None,
|
| 214 |
-
#prompt_templates=prompt_templates
|
| 215 |
-
)
|
| 216 |
-
|
| 217 |
|
| 218 |
demo.launch(debug=True, share=False)
|
|
|
|
| 13 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 14 |
class BasicAgent:
|
| 15 |
def __init__(self):
|
| 16 |
+
model = HfApiModel(
|
| 17 |
+
max_tokens=2096,
|
| 18 |
+
temperature=0.5,
|
| 19 |
+
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 20 |
+
custom_role_conversions=None,
|
| 21 |
+
)
|
| 22 |
print("BasicAgent initialized.")
|
| 23 |
def __call__(self, question: str) -> str:
|
| 24 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
|
|
|
| 27 |
return fixed_answer
|
| 28 |
|
| 29 |
|
| 30 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
|
| 33 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
|
|
| 203 |
|
| 204 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
| 205 |
|
| 206 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
|
| 208 |
demo.launch(debug=True, share=False)
|