Spaces:
Sleeping
Sleeping
namberino
commited on
Commit
·
bfd59d7
1
Parent(s):
48df675
Update generator
Browse files
app.py
CHANGED
|
@@ -161,7 +161,14 @@ async def generate_saved_endpoint(
|
|
| 161 |
enable_fiddler=enable_fiddler,
|
| 162 |
target_difficulty=difficulty,
|
| 163 |
)
|
| 164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
except Exception as e:
|
| 167 |
raise HTTPException(status_code=500, detail=f"Generation from saved file failed: {e}")
|
|
|
|
| 161 |
enable_fiddler=enable_fiddler,
|
| 162 |
target_difficulty=difficulty,
|
| 163 |
)
|
| 164 |
+
for qid, qobj in mcqs.items():
|
| 165 |
+
if qid not in all_mcqs:
|
| 166 |
+
all_mcqs[qid] = qobj
|
| 167 |
+
else:
|
| 168 |
+
if isinstance(all_mcqs[qid], list):
|
| 169 |
+
all_mcqs[qid].append(qobj)
|
| 170 |
+
else:
|
| 171 |
+
all_mcqs[qid] = [all_mcqs[qid], qobj]
|
| 172 |
|
| 173 |
except Exception as e:
|
| 174 |
raise HTTPException(status_code=500, detail=f"Generation from saved file failed: {e}")
|