FD900 commited on
Commit
89ab973
·
verified ·
1 Parent(s): 4d454dc

Update questions.py

Browse files
Files changed (1) hide show
  1. questions.py +11 -2
questions.py CHANGED
@@ -1,5 +1,14 @@
1
  import json
2
 
3
  def get_all_questions():
4
- with open("metadata.jsonl", "r", encoding="utf-8") as f:
5
- return [json.loads(line) for line in f]
 
 
 
 
 
 
 
 
 
 
1
  import json
2
 
3
  def get_all_questions():
4
+ try:
5
+ with open("metadata.jsonl", "r", encoding="utf-8") as f:
6
+ questions = [json.loads(line) for line in f]
7
+ print(f"✅ [questions.py] Loaded {len(questions)} questions from metadata.jsonl")
8
+ return questions
9
+ except FileNotFoundError:
10
+ print("❌ metadata.jsonl not found.")
11
+ return []
12
+ except json.JSONDecodeError as e:
13
+ print(f"❌ Failed to parse metadata.jsonl: {e}")
14
+ return []