Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -56,7 +56,7 @@ def extract_text_from_audio(file_path: str) -> str:
|
|
| 56 |
"Could you please introduce yourself and your background?"
|
| 57 |
"""
|
| 58 |
try:
|
| 59 |
-
return joblib.load(f"
|
| 60 |
|
| 61 |
except:
|
| 62 |
client = OpenAI()
|
|
@@ -67,7 +67,7 @@ def extract_text_from_audio(file_path: str) -> str:
|
|
| 67 |
file=audio_file,
|
| 68 |
response_format="text"
|
| 69 |
)
|
| 70 |
-
joblib.dump(transcription, f"
|
| 71 |
return transcription
|
| 72 |
|
| 73 |
@tool
|
|
@@ -92,7 +92,7 @@ def describe_image(request:str, file_path: str) -> str:
|
|
| 92 |
"""
|
| 93 |
|
| 94 |
try :
|
| 95 |
-
return joblib.load(f"
|
| 96 |
|
| 97 |
except:
|
| 98 |
client = OpenAI()
|
|
@@ -121,7 +121,7 @@ def describe_image(request:str, file_path: str) -> str:
|
|
| 121 |
}
|
| 122 |
],
|
| 123 |
)
|
| 124 |
-
joblib.dump(response.output_text,f"
|
| 125 |
return response.output_text
|
| 126 |
|
| 127 |
|
|
|
|
| 56 |
"Could you please introduce yourself and your background?"
|
| 57 |
"""
|
| 58 |
try:
|
| 59 |
+
return joblib.load(f"{file_path}")
|
| 60 |
|
| 61 |
except:
|
| 62 |
client = OpenAI()
|
|
|
|
| 67 |
file=audio_file,
|
| 68 |
response_format="text"
|
| 69 |
)
|
| 70 |
+
joblib.dump(transcription, f"{file_path}")
|
| 71 |
return transcription
|
| 72 |
|
| 73 |
@tool
|
|
|
|
| 92 |
"""
|
| 93 |
|
| 94 |
try :
|
| 95 |
+
return joblib.load(f"{file_path}")
|
| 96 |
|
| 97 |
except:
|
| 98 |
client = OpenAI()
|
|
|
|
| 121 |
}
|
| 122 |
],
|
| 123 |
)
|
| 124 |
+
joblib.dump(response.output_text,f"{file_path}")
|
| 125 |
return response.output_text
|
| 126 |
|
| 127 |
|