Spaces:
Sleeping
Sleeping
adding tools to CodeAgent
Browse files
app.py
CHANGED
@@ -36,13 +36,13 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
36 |
|
37 |
|
38 |
final_answer = FinalAnswerTool()
|
|
|
39 |
model = HfApiModel(
|
40 |
max_tokens=2096,
|
41 |
temperature=0.5,
|
42 |
model_id="https://jc26mwg228mkj8dw.us-east-1.aws.endpoints.huggingface.cloud/",
|
43 |
custom_role_conversions=None,
|
44 |
)
|
45 |
-
#model = InferenceClient("https://jc26mwg228mkj8dw.us-east-1.aws.endpoints.huggingface.cloud/")
|
46 |
|
47 |
# Import tool from Hub
|
48 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
@@ -52,7 +52,7 @@ with open("prompts.yaml", 'r') as 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,
|
|
|
36 |
|
37 |
|
38 |
final_answer = FinalAnswerTool()
|
39 |
+
|
40 |
model = HfApiModel(
|
41 |
max_tokens=2096,
|
42 |
temperature=0.5,
|
43 |
model_id="https://jc26mwg228mkj8dw.us-east-1.aws.endpoints.huggingface.cloud/",
|
44 |
custom_role_conversions=None,
|
45 |
)
|
|
|
46 |
|
47 |
# Import tool from Hub
|
48 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
|
|
52 |
|
53 |
agent = CodeAgent(
|
54 |
model=model,
|
55 |
+
tools=[final_answer, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
|
56 |
max_steps=6,
|
57 |
verbosity_level=1,
|
58 |
grammar=None,
|