Update app.py
Browse files
app.py
CHANGED
|
@@ -27,14 +27,14 @@ class BasicAgent:
|
|
| 27 |
model=HfApiModel(token=os.environ.get("HF_TOKEN")),
|
| 28 |
add_base_tools=True,
|
| 29 |
additional_authorized_imports=['requests', 'bs4'],
|
| 30 |
-
max_print_outputs_length =
|
| 31 |
)
|
| 32 |
HF_TOKEN=os.environ.get("HF_TOKEN")
|
| 33 |
headers = {
|
| 34 |
"Authorization": f"Bearer {HF_TOKEN}"
|
| 35 |
}
|
| 36 |
print("Agent initialised") # You have tools, always try to use them to answer.
|
| 37 |
-
answer = alfred.run(f"You are a general AI assistant. I will ask you a question. You have tools to answer them, always check it before anything else. Report your thoughts and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don’t use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don’t use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string. Here are the questions : {question}")
|
| 38 |
return answer
|
| 39 |
|
| 40 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
|
|
| 27 |
model=HfApiModel(token=os.environ.get("HF_TOKEN")),
|
| 28 |
add_base_tools=True,
|
| 29 |
additional_authorized_imports=['requests', 'bs4'],
|
| 30 |
+
max_print_outputs_length = 100
|
| 31 |
)
|
| 32 |
HF_TOKEN=os.environ.get("HF_TOKEN")
|
| 33 |
headers = {
|
| 34 |
"Authorization": f"Bearer {HF_TOKEN}"
|
| 35 |
}
|
| 36 |
print("Agent initialised") # You have tools, always try to use them to answer.
|
| 37 |
+
answer = alfred.run(f"You are a general AI assistant. I will ask you a question. You have tools to answer them, always check it before anything else. Mainly, you can extract the full content of wikipedia pages, do web searches and you have a tool for multimodal inputs. You must use them in priority if needed, before thinking of anything else. Report your thoughts and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don’t use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don’t use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string. Here are the questions : {question}")
|
| 38 |
return answer
|
| 39 |
|
| 40 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|