Spaces:
Sleeping
Sleeping
Samuel Thomas
commited on
Commit
·
ad021fc
1
Parent(s):
66a013c
correct api call
Browse files
app.py
CHANGED
|
@@ -39,6 +39,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 39 |
api_url = DEFAULT_API_URL
|
| 40 |
questions_url = f"{api_url}/questions"
|
| 41 |
submit_url = f"{api_url}/submit"
|
|
|
|
| 42 |
|
| 43 |
# 1. Fetch Questions
|
| 44 |
print(f"Fetching questions from: {questions_url}")
|
|
@@ -72,7 +73,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 72 |
else:
|
| 73 |
# Call the API to retrieve the file; adjust params as needed
|
| 74 |
task_id = item['task_id']
|
| 75 |
-
api_response = requests.get(f"{
|
| 76 |
print(f"api_response = {api_response.status_code}")
|
| 77 |
if api_response.status_code == 200:
|
| 78 |
item['input_file'] = api_response.content # Store file as bytes
|
|
|
|
| 39 |
api_url = DEFAULT_API_URL
|
| 40 |
questions_url = f"{api_url}/questions"
|
| 41 |
submit_url = f"{api_url}/submit"
|
| 42 |
+
files_url = f"{api_url}/files"
|
| 43 |
|
| 44 |
# 1. Fetch Questions
|
| 45 |
print(f"Fetching questions from: {questions_url}")
|
|
|
|
| 73 |
else:
|
| 74 |
# Call the API to retrieve the file; adjust params as needed
|
| 75 |
task_id = item['task_id']
|
| 76 |
+
api_response = requests.get(f"{files_url}/{task_id}")
|
| 77 |
print(f"api_response = {api_response.status_code}")
|
| 78 |
if api_response.status_code == 200:
|
| 79 |
item['input_file'] = api_response.content # Store file as bytes
|