SergeyO7 commited on
Commit
7b32da2
·
verified ·
1 Parent(s): a37442d

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +12 -7
agent.py CHANGED
@@ -359,15 +359,20 @@ class MagAgent:
359
  "final_answer": "Default answer format: {answer}"
360
  }
361
 
362
- try:
363
- with open("prompts.yaml") as f:
364
- self.prompt_templates = yaml.safe_load(f)
365
- except Exception as e:
366
- self.prompt_templates = {
367
- "base_prompt": "Default base prompt...",
368
- "task_prompt": "Default task template: {question}"
369
  }
370
 
 
 
 
 
 
371
  self.agent = CodeAgent(
372
  model=self.model,
373
  tools=self.tools,
 
359
  "final_answer": "Default answer format: {answer}"
360
  }
361
 
362
+ # try:
363
+ # with open("prompts.yaml") as f:
364
+ # self.prompt_templates = yaml.safe_load(f)
365
+ # except Exception as e:
366
+ # self.prompt_templates = {
367
+ # "base_prompt": "Default base prompt...",
368
+ # "task_prompt": "Default task template: {question}"
369
  }
370
 
371
+ # Load prompt templates
372
+ with open("prompts.yaml", 'r') as stream:
373
+ self.prompt_templates = yaml.safe_load(stream)
374
+
375
+
376
  self.agent = CodeAgent(
377
  model=self.model,
378
  tools=self.tools,