Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
|
@@ -112,14 +112,16 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 112 |
time.sleep(10)
|
| 113 |
task_id = item.get("task_id")
|
| 114 |
question_text = item.get("question")
|
|
|
|
|
|
|
| 115 |
|
| 116 |
# Check if there is a additional file to be used
|
| 117 |
if item.get("file_name"):
|
| 118 |
file = requests.get(f"{api_url}/files/{task_id}")
|
| 119 |
content_type = file.headers.get("Content-Type")
|
| 120 |
|
| 121 |
-
|
| 122 |
-
|
| 123 |
|
| 124 |
|
| 125 |
|
|
|
|
| 112 |
time.sleep(10)
|
| 113 |
task_id = item.get("task_id")
|
| 114 |
question_text = item.get("question")
|
| 115 |
+
content_type = None
|
| 116 |
+
content = None
|
| 117 |
|
| 118 |
# Check if there is a additional file to be used
|
| 119 |
if item.get("file_name"):
|
| 120 |
file = requests.get(f"{api_url}/files/{task_id}")
|
| 121 |
content_type = file.headers.get("Content-Type")
|
| 122 |
|
| 123 |
+
if content_type == "image/png":
|
| 124 |
+
content = file.content
|
| 125 |
|
| 126 |
|
| 127 |
|