jfataphd commited on
Commit
1b73f21
·
1 Parent(s): ae598a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -940,22 +940,22 @@ if query:
940
  dataset = Dataset.from_dict({'id': [], 'text': []})
941
 
942
  def save_comment(comment):
943
- # Check if the comments directory exists
944
- if os.path.exists('comments'):
945
- # Load the dataset from disk
946
- dataset = Dataset.load_from_disk('comments')
947
- else:
948
- # Create a new dataset
949
- dataset = Dataset.from_dict({'id': [], 'text': []})
950
 
951
- # Add the comment to the dataset
952
- dataset['id'].append(len(dataset))
953
- dataset['text'].append(comment)
954
 
955
- # Save the dataset to disk
956
- dataset.save_to_disk('comments')
957
 
958
- print('Comment saved to dataset.')
959
 
960
 
961
  st.title("Abstractalytics Web App")
 
940
  dataset = Dataset.from_dict({'id': [], 'text': []})
941
 
942
  def save_comment(comment):
943
+ # Check if the comments directory exists
944
+ if os.path.exists('comments'):
945
+ # Load the dataset from disk
946
+ dataset = Dataset.load_from_disk('comments')
947
+ else:
948
+ # Create a new dataset
949
+ dataset = Dataset.from_dict({'id': [], 'text': []})
950
 
951
+ # Add the comment to the dataset
952
+ dataset['id'].append(len(dataset))
953
+ dataset['text'].append(comment)
954
 
955
+ # Save the dataset to disk
956
+ dataset.save_to_disk('comments')
957
 
958
+ print('Comment saved to dataset.')
959
 
960
 
961
  st.title("Abstractalytics Web App")