tykiww commited on
Commit
dfd7ad6
1 Parent(s): 6d57565

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -47,15 +47,13 @@ class get_datasets:
47
 
48
  def uploaded_dataset(file):
49
  dataset = []
50
- print(file)
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