Spaces:
Sleeping
Sleeping
volker
commited on
Commit
·
c3fb675
1
Parent(s):
86676cc
Update excel reading and transcription.
Browse files- basic_agent.py +2 -2
- requirements.txt +1 -0
basic_agent.py
CHANGED
@@ -71,7 +71,7 @@ class BasicSmolAgent:
|
|
71 |
if not model:
|
72 |
model = HfApiModel()
|
73 |
search_tool = DuckDuckGoSearchToolWH()
|
74 |
-
self.agent = CodeAgent(tools=[search_tool], model=model, max_steps=10)
|
75 |
self.prompt = ("The question is the following:\n ```{}```"
|
76 |
" YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings."
|
77 |
" If you are asked for a number, don't use comma to write your number neither use units"
|
@@ -104,7 +104,7 @@ class BasicSmolAgent:
|
|
104 |
prompted_question += f"\nThere is textual data included with the question, it is from a file {fpath} and is: ```{data}```"
|
105 |
if fpath.endswith('.mp3'):
|
106 |
try:
|
107 |
-
result = self.mp3_pipe(fpath)
|
108 |
text = result["text"]
|
109 |
prompted_question += f"\nThere is textual data included with the question, it is from a file {fpath} and is: ```{text}```"
|
110 |
except Exception as e:
|
|
|
71 |
if not model:
|
72 |
model = HfApiModel()
|
73 |
search_tool = DuckDuckGoSearchToolWH()
|
74 |
+
self.agent = CodeAgent(tools=[search_tool], model=model, max_steps=10, additional_authorized_imports=['pandas'])
|
75 |
self.prompt = ("The question is the following:\n ```{}```"
|
76 |
" YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings."
|
77 |
" If you are asked for a number, don't use comma to write your number neither use units"
|
|
|
104 |
prompted_question += f"\nThere is textual data included with the question, it is from a file {fpath} and is: ```{data}```"
|
105 |
if fpath.endswith('.mp3'):
|
106 |
try:
|
107 |
+
result = self.mp3_pipe(fpath, return_timestamps=True)
|
108 |
text = result["text"]
|
109 |
prompted_question += f"\nThere is textual data included with the question, it is from a file {fpath} and is: ```{text}```"
|
110 |
except Exception as e:
|
requirements.txt
CHANGED
@@ -3,6 +3,7 @@ requests
|
|
3 |
openai
|
4 |
python-dotenv
|
5 |
pandas
|
|
|
6 |
duckduckgo_search
|
7 |
smolagents
|
8 |
transformers
|
|
|
3 |
openai
|
4 |
python-dotenv
|
5 |
pandas
|
6 |
+
openpyxl
|
7 |
duckduckgo_search
|
8 |
smolagents
|
9 |
transformers
|