Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -92,19 +92,19 @@ class BasicAgent:
|
|
92 |
|
93 |
if file_info.endswith((".png", ".jpg", ".jpeg")):
|
94 |
print("coso Image file detected, processing with GPT-4o")
|
95 |
-
image = self._load_image(
|
96 |
response = self._ask_gpt4o_with_image(image, text)
|
97 |
return response
|
98 |
|
99 |
elif file_info.endswith(".wav") or file_name.endswith(".mp3"):
|
100 |
print("coso Audio file detected, processing with Whisper")
|
101 |
-
audio_bytes = self._load_bytes(
|
102 |
transcription = self._transcribe_audio(audio_bytes)
|
103 |
return self._ask_gpt4o(transcription)
|
104 |
|
105 |
elif file_info.endswith(".txt"):
|
106 |
print("coso Text file detected")
|
107 |
-
text_content = self._load_text(
|
108 |
return self._ask_gpt4o(text_content)
|
109 |
|
110 |
|
|
|
92 |
|
93 |
if file_info.endswith((".png", ".jpg", ".jpeg")):
|
94 |
print("coso Image file detected, processing with GPT-4o")
|
95 |
+
image = self._load_image(file_info)
|
96 |
response = self._ask_gpt4o_with_image(image, text)
|
97 |
return response
|
98 |
|
99 |
elif file_info.endswith(".wav") or file_name.endswith(".mp3"):
|
100 |
print("coso Audio file detected, processing with Whisper")
|
101 |
+
audio_bytes = self._load_bytes(file_info)
|
102 |
transcription = self._transcribe_audio(audio_bytes)
|
103 |
return self._ask_gpt4o(transcription)
|
104 |
|
105 |
elif file_info.endswith(".txt"):
|
106 |
print("coso Text file detected")
|
107 |
+
text_content = self._load_text(file_info)
|
108 |
return self._ask_gpt4o(text_content)
|
109 |
|
110 |
|