Spaces:
Sleeping
Sleeping
dev: finding file is local path
Browse files
app.py
CHANGED
@@ -138,7 +138,16 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
138 |
question_file_name = item.get("file_name")
|
139 |
print("\nquestion level: ", question_level)
|
140 |
print("question file_name: ", question_file_name)
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
if not task_id or question_text is None:
|
144 |
print(f"Skipping item with missing task_id or question: {item}")
|
|
|
138 |
question_file_name = item.get("file_name")
|
139 |
print("\nquestion level: ", question_level)
|
140 |
print("question file_name: ", question_file_name)
|
141 |
+
|
142 |
+
found= False
|
143 |
+
for root, dirs, files in os.walk("/"):
|
144 |
+
if question_file_name in files:
|
145 |
+
print("FILE FOUND AT:", os.path.join(root, "cca530fc-4052-43b2-b130-b30968d8aa44.png"))
|
146 |
+
found=True
|
147 |
+
if not found:
|
148 |
+
print("FILE WAS NOT FOUND LOCALLY... try making an api request to .files/ or ./static in the hf.space target (or check it manually first)")
|
149 |
+
import sys
|
150 |
+
sys.exit()
|
151 |
|
152 |
if not task_id or question_text is None:
|
153 |
print(f"Skipping item with missing task_id or question: {item}")
|