Spaces:
Sleeping
Sleeping
Delete questions.py
Browse files- questions.py +0 -19
questions.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
|
| 3 |
-
def fix_keys(obj):
|
| 4 |
-
if "Question" in obj:
|
| 5 |
-
obj["question"] = obj.pop("Question")
|
| 6 |
-
return obj
|
| 7 |
-
|
| 8 |
-
def get_all_questions():
|
| 9 |
-
try:
|
| 10 |
-
with open("metadata.jsonl", "r", encoding="utf-8") as f:
|
| 11 |
-
questions = [json.loads(line) for line in f]
|
| 12 |
-
print(f"✅ [questions.py] Loaded {len(questions)} questions from metadata.jsonl")
|
| 13 |
-
return questions
|
| 14 |
-
except FileNotFoundError:
|
| 15 |
-
print("❌ metadata.jsonl not found.")
|
| 16 |
-
return []
|
| 17 |
-
except json.JSONDecodeError as e:
|
| 18 |
-
print(f"❌ Failed to parse metadata.jsonl: {e}")
|
| 19 |
-
return []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|