Spaces:
Sleeping
Sleeping
Added debugging statement to verify file fetching logic
Browse files
app.py
CHANGED
@@ -169,6 +169,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
169 |
question_text = item.get("question")
|
170 |
file_name = item.get("file_name")
|
171 |
file_type = "unknown"
|
|
|
|
|
172 |
if file_name:
|
173 |
print(f"Fetching file content for task ID: {task_id}")
|
174 |
try:
|
@@ -187,7 +189,6 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
187 |
with open(file_name, "wb") as image_file:
|
188 |
image_file.write(file_response.content)
|
189 |
print(f"Saved image file: {file_name}")
|
190 |
-
|
191 |
elif file_extension in ['.wav', '.mp3', '.ogg']:
|
192 |
# If the file is an audio file, convert it to text
|
193 |
file_type = "audio"
|
@@ -198,7 +199,6 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
198 |
with open(file_name, "wb") as audio_file:
|
199 |
audio_file.write(file_response.content)
|
200 |
print(f"Saved audio file: {file_name}")
|
201 |
-
|
202 |
elif file_extension in ['.py']:
|
203 |
# If the file is a Python file, you might want to run it or analyze it
|
204 |
file_type = "python"
|
|
|
169 |
question_text = item.get("question")
|
170 |
file_name = item.get("file_name")
|
171 |
file_type = "unknown"
|
172 |
+
print(f"Fetching file content '{file_name}' for task ID: {task_id}")
|
173 |
+
|
174 |
if file_name:
|
175 |
print(f"Fetching file content for task ID: {task_id}")
|
176 |
try:
|
|
|
189 |
with open(file_name, "wb") as image_file:
|
190 |
image_file.write(file_response.content)
|
191 |
print(f"Saved image file: {file_name}")
|
|
|
192 |
elif file_extension in ['.wav', '.mp3', '.ogg']:
|
193 |
# If the file is an audio file, convert it to text
|
194 |
file_type = "audio"
|
|
|
199 |
with open(file_name, "wb") as audio_file:
|
200 |
audio_file.write(file_response.content)
|
201 |
print(f"Saved audio file: {file_name}")
|
|
|
202 |
elif file_extension in ['.py']:
|
203 |
# If the file is a Python file, you might want to run it or analyze it
|
204 |
file_type = "python"
|