Spaces:
Sleeping
Sleeping
Samuel Thomas
commited on
Commit
·
ad1ff94
1
Parent(s):
c1d0e30
debug loop
Browse files
app.py
CHANGED
@@ -63,20 +63,20 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
63 |
# 2. Create states
|
64 |
for item in hf_questions:
|
65 |
file_name = item.get('file_name', '')
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
else:
|
71 |
-
# Call the API to retrieve the file; adjust params as needed
|
72 |
-
task_id = item['task_id']
|
73 |
-
api_response = requests.get(f"{api_url}/{task_id}")
|
74 |
-
if api_response.status_code == 200:
|
75 |
-
item['input_file'] = api_response.content # Store file as bytes
|
76 |
-
item['file_type'] = get_file_type(file_name)
|
77 |
-
item['file_path'] = write_bytes_to_temp_dir(item['input_file'], file_name)
|
78 |
else:
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
82 |
try:
|
|
|
63 |
# 2. Create states
|
64 |
for item in hf_questions:
|
65 |
file_name = item.get('file_name', '')
|
66 |
+
if file_name == '':
|
67 |
+
item['input_file'] = None
|
68 |
+
item['file_type'] = None
|
69 |
+
item['file_path'] = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
else:
|
71 |
+
# Call the API to retrieve the file; adjust params as needed
|
72 |
+
task_id = item['task_id']
|
73 |
+
api_response = requests.get(f"{api_url}/{task_id}")
|
74 |
+
if api_response.status_code == 200:
|
75 |
+
item['input_file'] = api_response.content # Store file as bytes
|
76 |
+
item['file_type'] = get_file_type(file_name)
|
77 |
+
item['file_path'] = write_bytes_to_temp_dir(item['input_file'], file_name)
|
78 |
+
else:
|
79 |
+
item['input_file'] = None # Or handle error as needed
|
80 |
|
81 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
82 |
try:
|