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