Spaces:
Sleeping
Sleeping
added @tool
Browse files
app.py
CHANGED
|
@@ -22,21 +22,21 @@ image_captioner = pipeline(
|
|
| 22 |
"image-to-text",
|
| 23 |
model="Salesforce/blip-image-captioning-base"
|
| 24 |
)
|
| 25 |
-
|
| 26 |
def describe_image(path):
|
| 27 |
"""Describes the image. requires image path. return image description.
|
| 28 |
Args: path of image
|
| 29 |
"""
|
| 30 |
return image_captioner(path)[0]["generated_text"]
|
| 31 |
|
| 32 |
-
|
| 33 |
def audio_to_text_tool(audio_file_path):
|
| 34 |
"""Converts audio file to text. requires audio file path. return transcribed text.
|
| 35 |
Args: path of audio data file
|
| 36 |
"""
|
| 37 |
output = SpeechToTextTool()
|
| 38 |
return output
|
| 39 |
-
|
| 40 |
def excel_reader(file_path):
|
| 41 |
""" reads an excel file. Requires the file path as input. Return rows and columns of a data frame.
|
| 42 |
Args: file path as input
|
|
|
|
| 22 |
"image-to-text",
|
| 23 |
model="Salesforce/blip-image-captioning-base"
|
| 24 |
)
|
| 25 |
+
@tool
|
| 26 |
def describe_image(path):
|
| 27 |
"""Describes the image. requires image path. return image description.
|
| 28 |
Args: path of image
|
| 29 |
"""
|
| 30 |
return image_captioner(path)[0]["generated_text"]
|
| 31 |
|
| 32 |
+
@tool
|
| 33 |
def audio_to_text_tool(audio_file_path):
|
| 34 |
"""Converts audio file to text. requires audio file path. return transcribed text.
|
| 35 |
Args: path of audio data file
|
| 36 |
"""
|
| 37 |
output = SpeechToTextTool()
|
| 38 |
return output
|
| 39 |
+
@tool
|
| 40 |
def excel_reader(file_path):
|
| 41 |
""" reads an excel file. Requires the file path as input. Return rows and columns of a data frame.
|
| 42 |
Args: file path as input
|