CognitiveScience commited on
Commit
8a910cd
1 Parent(s): 4c18288

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -134,7 +134,7 @@ def backup_db():
134
  shutil.copyfile(DB_FILE, "./reviews01.db")
135
  db = sqlite3.connect(DB_FILE)
136
  reviews = db.execute("SELECT * FROM reviews").fetchall()
137
- pd.DataFrame(reviews).to_csv("./reviews1.csv", index=False)
138
  print("updating db")
139
  repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
140
 
@@ -142,9 +142,9 @@ def backup_db_csv():
142
  shutil.copyfile(DB_FILE, "./reviews01.db")
143
  db = sqlite3.connect(DB_FILE)
144
  reviews = db.execute("SELECT * FROM reviews").fetchall()
145
- pd.DataFrame(reviews).to_csv("./reviews1.csv", index=False)
146
  print("updating db csv")
147
- dataset = load_dataset("csv", data_files="./reviews1.csv")
148
  repo.push_to_hub("CognitiveScience/csdhdata", blocking=False) #, commit_message=f"Updating data-csv at {datetime.datetime.now()}")
149
  path1=hf_hub_url()
150
  print (path1)
 
134
  shutil.copyfile(DB_FILE, "./reviews01.db")
135
  db = sqlite3.connect(DB_FILE)
136
  reviews = db.execute("SELECT * FROM reviews").fetchall()
137
+ pd.DataFrame(reviews).to_csv("./reviews.csv", index=False)
138
  print("updating db")
139
  repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
140
 
 
142
  shutil.copyfile(DB_FILE, "./reviews01.db")
143
  db = sqlite3.connect(DB_FILE)
144
  reviews = db.execute("SELECT * FROM reviews").fetchall()
145
+ #pd.DataFrame(reviews).to_csv("./reviews1.csv", index=False)
146
  print("updating db csv")
147
+ dataset = load_dataset("csv", data_files="./reviews.csv")
148
  repo.push_to_hub("CognitiveScience/csdhdata", blocking=False) #, commit_message=f"Updating data-csv at {datetime.datetime.now()}")
149
  path1=hf_hub_url()
150
  print (path1)