saisravanthi8333 commited on
Commit
5c06aa5
·
verified ·
1 Parent(s): aa32b77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -19
app.py CHANGED
@@ -36,31 +36,18 @@ def get_current_time_in_timezone(timezone: str) -> str:
36
 
37
  final_answer = FinalAnswerTool()
38
  model = HfApiModel(
39
- max_tokens=2096,
40
- temperature=0.5,
41
- model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
42
- custom_role_conversions=None,
43
  )
44
 
45
-
46
- # Import tool from Hub
47
- image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
48
-
49
- # Load system prompt from prompt.yaml file
50
- with open("prompts.yaml", 'r') as stream:
51
- prompt_templates = yaml.safe_load(stream)
52
-
53
  agent = CodeAgent(
54
  model=model,
55
- tools=[final_answer], # add your tools here (don't remove final_answer)
56
  max_steps=6,
57
  verbosity_level=1,
58
- grammar=None,
59
- planning_interval=None,
60
- name=None,
61
- description=None,
62
- prompt_templates=prompt_templates # Pass system prompt to CodeAgent
63
  )
64
 
65
-
66
  GradioUI(agent).launch()
 
36
 
37
  final_answer = FinalAnswerTool()
38
  model = HfApiModel(
39
+ model_id="meta-llama/Llama-2-7b-chat-hf",
40
+ max_tokens=512,
41
+ temperature=0.5
 
42
  )
43
 
 
 
 
 
 
 
 
 
44
  agent = CodeAgent(
45
  model=model,
46
+ tools=[final_answer, my_custom_tool, get_current_time_in_timezone],
47
  max_steps=6,
48
  verbosity_level=1,
49
+ name="my_huggingface_agent",
50
+ system_prompt="You are a helpful AI agent that can answer questions and use tools."
 
 
 
51
  )
52
 
 
53
  GradioUI(agent).launch()