Spaces:
Sleeping
Sleeping
small bug correction
Browse files- simuGAIA.py +6 -3
simuGAIA.py
CHANGED
|
@@ -254,9 +254,12 @@ def run_simuGAIA_all( profile: gr.OAuthProfile | None, submit: Optional[bool] =
|
|
| 254 |
json_path = "already_answered.json"
|
| 255 |
try:
|
| 256 |
if os.path.exists(json_path):
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
|
|
|
|
|
|
|
|
|
| 260 |
data = []
|
| 261 |
else:
|
| 262 |
data = []
|
|
|
|
| 254 |
json_path = "already_answered.json"
|
| 255 |
try:
|
| 256 |
if os.path.exists(json_path):
|
| 257 |
+
try:
|
| 258 |
+
with open(json_path, "r", encoding="utf-8") as f:
|
| 259 |
+
data = json.load(f)
|
| 260 |
+
if not isinstance(data, list):
|
| 261 |
+
data = []
|
| 262 |
+
except (json.JSONDecodeError, ValueError):
|
| 263 |
data = []
|
| 264 |
else:
|
| 265 |
data = []
|