Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -753,6 +753,7 @@ def fetch_questions() -> Tuple[str, Optional[pd.DataFrame]]:
|
|
753 |
|
754 |
api_url = DEFAULT_API_URL
|
755 |
questions_url = f"{api_url}/questions"
|
|
|
756 |
|
757 |
print(f"Fetching questions from: {questions_url}")
|
758 |
try:
|
@@ -773,9 +774,11 @@ def fetch_questions() -> Tuple[str, Optional[pd.DataFrame]]:
|
|
773 |
file_info = ""
|
774 |
|
775 |
file_name = item.get("file_name", "")
|
|
|
776 |
if file_name and file_name.strip():
|
777 |
has_file = True
|
778 |
file_info = file_name
|
|
|
779 |
|
780 |
# Check if question contains URLs
|
781 |
question_text = item.get("question", "")
|
|
|
753 |
|
754 |
api_url = DEFAULT_API_URL
|
755 |
questions_url = f"{api_url}/questions"
|
756 |
+
files_url = f"{api_url}/files"
|
757 |
|
758 |
print(f"Fetching questions from: {questions_url}")
|
759 |
try:
|
|
|
774 |
file_info = ""
|
775 |
|
776 |
file_name = item.get("file_name", "")
|
777 |
+
item_id = item.get("task_id")
|
778 |
if file_name and file_name.strip():
|
779 |
has_file = True
|
780 |
file_info = file_name
|
781 |
+
file_data = requests.get(f"{files_url}/{item_id}")
|
782 |
|
783 |
# Check if question contains URLs
|
784 |
question_text = item.get("question", "")
|