SilviuMatei commited on
Commit
f49ef96
·
verified ·
1 Parent(s): 604becc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -1
app.py CHANGED
@@ -35,4 +35,38 @@ def get_device_info() -> str:
35
  device_info = page.evaluate(script)
36
  browser.close()
37
 
38
- return device_info
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  device_info = page.evaluate(script)
36
  browser.close()
37
 
38
+ return device_info
39
+
40
+
41
+ final_answer = FinalAnswerTool()
42
+
43
+ # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
44
+ # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
45
+
46
+ model = HfApiModel(
47
+ max_tokens=2096,
48
+ temperature=0.5,
49
+ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
50
+ custom_role_conversions=None,
51
+ )
52
+
53
+ # Import tool from Hub
54
+ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
55
+
56
+ with open("prompts.yaml", 'r') as stream:
57
+ prompt_templates = yaml.safe_load(stream)
58
+
59
+ agent = CodeAgent(
60
+ model=model,
61
+ tools=[final_answer], ## add your tools here (don't remove final answer)
62
+ max_steps=6,
63
+ verbosity_level=1,
64
+ grammar=None,
65
+ planning_interval=None,
66
+ name=None,
67
+ description=None,
68
+ prompt_templates=prompt_templates
69
+ )
70
+
71
+
72
+ GradioUI(agent).launch()