Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,17 +28,15 @@ if response.status is False:
|
|
| 28 |
create_failed_gradio_ui()
|
| 29 |
|
| 30 |
else:
|
| 31 |
-
pass
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
-
'''
|
| 42 |
'''
|
| 43 |
model = LiteLLMModel(
|
| 44 |
model_id="gemini/gemini-2.0-flash-exp",
|
|
@@ -49,30 +47,26 @@ model = LiteLLMModel(
|
|
| 49 |
|
| 50 |
'''
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
'''
|
| 56 |
-
|
| 57 |
-
# Load prompts
|
| 58 |
-
combined_prompts = load_prompts()
|
| 59 |
-
combined_tools = load_tools() ## from the tools folder (don't remove final answer)
|
| 60 |
-
|
| 61 |
-
agent = CodeAgent(
|
| 62 |
-
model=model,
|
| 63 |
-
tools=combined_tools,
|
| 64 |
-
max_steps=6,
|
| 65 |
-
verbosity_level=3,
|
| 66 |
-
grammar=None,
|
| 67 |
-
planning_interval=None,
|
| 68 |
-
name="Content Agent",
|
| 69 |
-
description="Evaluates whether text is polite or impolite. ",
|
| 70 |
-
prompt_templates=combined_prompts,
|
| 71 |
-
additional_authorized_imports=["pytz"]
|
| 72 |
-
|
| 73 |
-
)
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
GradioUI(agent).launch()
|
| 77 |
-
|
| 78 |
-
'''
|
|
|
|
| 28 |
create_failed_gradio_ui()
|
| 29 |
|
| 30 |
else:
|
|
|
|
| 31 |
|
| 32 |
+
model = HfApiModel(
|
| 33 |
+
max_tokens=2096,
|
| 34 |
+
temperature=0.5,
|
| 35 |
+
model_id= endpoint_uri,
|
| 36 |
+
custom_role_conversions=None,
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
|
|
|
|
| 40 |
'''
|
| 41 |
model = LiteLLMModel(
|
| 42 |
model_id="gemini/gemini-2.0-flash-exp",
|
|
|
|
| 47 |
|
| 48 |
'''
|
| 49 |
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
# Load prompts
|
| 53 |
+
combined_prompts = load_prompts()
|
| 54 |
+
combined_tools = load_tools() ## from the tools folder (don't remove final answer)
|
| 55 |
+
|
| 56 |
+
agent = CodeAgent(
|
| 57 |
+
model=model,
|
| 58 |
+
tools=combined_tools,
|
| 59 |
+
max_steps=6,
|
| 60 |
+
verbosity_level=3,
|
| 61 |
+
grammar=None,
|
| 62 |
+
planning_interval=None,
|
| 63 |
+
name="Content Agent",
|
| 64 |
+
description="Evaluates whether text is polite or impolite. ",
|
| 65 |
+
prompt_templates=combined_prompts,
|
| 66 |
+
additional_authorized_imports=["pytz"]
|
| 67 |
+
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
GradioUI(agent).launch()
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|