Spaces:
Runtime error
Runtime error
Scott Cogan commited on
Commit ·
ab54c2a
1
Parent(s): 7c56010
Fix: Update app.py with YAML validation and pin smolagents version
Browse files- app.py +7 -1
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -70,7 +70,13 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
|
|
| 70 |
|
| 71 |
with open("prompts.yaml", 'r') as stream:
|
| 72 |
yaml_content = yaml.safe_load(stream)
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
agent = CodeAgent(
|
| 76 |
model=model,
|
|
|
|
| 70 |
|
| 71 |
with open("prompts.yaml", 'r') as stream:
|
| 72 |
yaml_content = yaml.safe_load(stream)
|
| 73 |
+
if not isinstance(yaml_content, dict):
|
| 74 |
+
raise ValueError("YAML content must be a dictionary")
|
| 75 |
+
if 'prompt_templates' not in yaml_content:
|
| 76 |
+
raise ValueError("YAML must contain 'prompt_templates' key")
|
| 77 |
+
prompt_templates = yaml_content['prompt_templates']
|
| 78 |
+
if not isinstance(prompt_templates, dict):
|
| 79 |
+
raise ValueError("prompt_templates must be a dictionary")
|
| 80 |
|
| 81 |
agent = CodeAgent(
|
| 82 |
model=model,
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
markdownify
|
| 2 |
-
smolagents
|
| 3 |
requests
|
| 4 |
duckduckgo_search
|
| 5 |
pandas
|
|
|
|
| 1 |
markdownify
|
| 2 |
+
smolagents==0.1.0
|
| 3 |
requests
|
| 4 |
duckduckgo_search
|
| 5 |
pandas
|