Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,16 +24,6 @@ def joke_generator(arg1:str, arg2:str)-> str: #it's import to specify the return
|
|
| 24 |
]
|
| 25 |
return random.choice(Jokes)
|
| 26 |
|
| 27 |
-
@tool
|
| 28 |
-
def generate_meme(args1:str , args2: int) -> str:
|
| 29 |
-
"""creates a meme with a given text
|
| 30 |
-
Args:
|
| 31 |
-
arg1: A text to be placed in the meme
|
| 32 |
-
arg2: A dummy string arguement
|
| 33 |
-
"""
|
| 34 |
-
hf_client = InferenceClient("https://some-hf-meme-model-url")
|
| 35 |
-
response = hf_client.text_to_image(arg1)
|
| 36 |
-
return response.get("image_url", "Failed to generate meme")
|
| 37 |
|
| 38 |
@tool
|
| 39 |
def random_fact(arg1: str, arg2: int) -> str:
|
|
@@ -87,7 +77,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 87 |
|
| 88 |
agent = CodeAgent(
|
| 89 |
model=model,
|
| 90 |
-
tools=[final_answer,joke_generator,
|
| 91 |
max_steps=6,
|
| 92 |
verbosity_level=1,
|
| 93 |
grammar=None,
|
|
|
|
| 24 |
]
|
| 25 |
return random.choice(Jokes)
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
@tool
|
| 29 |
def random_fact(arg1: str, arg2: int) -> str:
|
|
|
|
| 77 |
|
| 78 |
agent = CodeAgent(
|
| 79 |
model=model,
|
| 80 |
+
tools=[final_answer,joke_generator,random_fact], ## add your tools here (don't remove final answer)
|
| 81 |
max_steps=6,
|
| 82 |
verbosity_level=1,
|
| 83 |
grammar=None,
|