Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,39 +37,42 @@ def destiny_still_arrives(name:str, dob:str)-> dict: #it's import to specify the
|
|
| 37 |
month = datetime.strptime(dob, "%Y-%m-%d").strftime("%B")
|
| 38 |
birthstone = birthstones.get(month, "Unknown")
|
| 39 |
|
| 40 |
-
model = HfApiModel(
|
| 41 |
-
max_tokens=2096,
|
| 42 |
-
temperature=0.5,
|
| 43 |
-
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 44 |
-
custom_role_conversions=None,
|
| 45 |
-
)
|
| 46 |
|
| 47 |
|
| 48 |
-
# Import tool from Hub
|
| 49 |
-
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 50 |
|
| 51 |
-
with open("prompts.yaml", 'r') as stream:
|
| 52 |
-
|
| 53 |
|
| 54 |
-
agent = CodeAgent(
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
)
|
| 65 |
|
| 66 |
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
if birthstone in image_urls:
|
| 69 |
-
response =
|
| 70 |
else:
|
| 71 |
-
response =
|
| 72 |
-
|
| 73 |
return response
|
| 74 |
|
| 75 |
@tool
|
|
|
|
| 37 |
month = datetime.strptime(dob, "%Y-%m-%d").strftime("%B")
|
| 38 |
birthstone = birthstones.get(month, "Unknown")
|
| 39 |
|
| 40 |
+
# model = HfApiModel(
|
| 41 |
+
# max_tokens=2096,
|
| 42 |
+
# temperature=0.5,
|
| 43 |
+
# model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 44 |
+
# custom_role_conversions=None,
|
| 45 |
+
# )
|
| 46 |
|
| 47 |
|
| 48 |
+
# # Import tool from Hub
|
| 49 |
+
# image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 50 |
|
| 51 |
+
# with open("prompts.yaml", 'r') as stream:
|
| 52 |
+
# prompt_templates = yaml.safe_load(stream)
|
| 53 |
|
| 54 |
+
# agent = CodeAgent(
|
| 55 |
+
# model=model,
|
| 56 |
+
# tools=[final_answer,image_generation_tool,DuckDuckGoSearchTool()], ## add your tools here (don't remove final answer)
|
| 57 |
+
# max_steps=6,
|
| 58 |
+
# verbosity_level=1,
|
| 59 |
+
# grammar=None,
|
| 60 |
+
# planning_interval=None,
|
| 61 |
+
# name=None,
|
| 62 |
+
# description=None,
|
| 63 |
+
# prompt_templates=prompt_templates
|
| 64 |
+
# )
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
+
# # if birthstone in image_urls:
|
| 69 |
+
# response = agent.run(f"Please find out the meaning of the following name: {name}, then Generate an image of the following birthstone: {birthstone} and finally a horoscope reading of the current day")
|
| 70 |
+
# else:
|
| 71 |
+
# response = agent.run(f"Please find out the meaning of the following name: {name}, then finally a horoscope reading of the current day")
|
| 72 |
if birthstone in image_urls:
|
| 73 |
+
response = f"Please find out the meaning of the following name: {name}, then Generate an image of the following birthstone: {birthstone} and finally a horoscope reading of the current day"
|
| 74 |
else:
|
| 75 |
+
response = f"Please find out the meaning of the following name: {name}, then finally a horoscope reading of the current day"
|
|
|
|
| 76 |
return response
|
| 77 |
|
| 78 |
@tool
|