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