Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,12 +49,14 @@ class get_datasets:
|
|
49 |
dataset = []
|
50 |
if file is None:
|
51 |
return "File not found. Please upload the file again."
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
58 |
|
59 |
|
60 |
|
|
|
49 |
dataset = []
|
50 |
if file is None:
|
51 |
return "File not found. Please upload the file again."
|
52 |
+
try:
|
53 |
+
with open(file,'r') as file:
|
54 |
+
for line in file:
|
55 |
+
dataset.append(json.loads(line.strip()))
|
56 |
+
print(dataset[0]['query'])
|
57 |
+
return dataset
|
58 |
+
except FileNotFoundError:
|
59 |
+
return "File not found. Please upload the file again."
|
60 |
|
61 |
|
62 |
|