CognitiveScience commited on
Commit
604d4bf
1 Parent(s): ab32890

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -200,28 +200,28 @@ with gr.Blocks(css=css) as demo:
200
  #run_code()
201
  #demo.load(get_latest_reviews, celsci, [data, count])
202
  #return "Hello " + name + "!"
203
- def backup_db():
204
- #shutil.copyfile(DB_FILE, "./reviews.db")
205
- #db = sqlite3.connect(DB_FILE)
206
- #reviews = db.execute("SELECT * FROM reviews").fetchall()
207
- pd.DataFrame(reviews).to_csv("./reviews.csv", index=False)
208
- print("updating db")
209
- repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
210
 
211
- def backup_db_csv():
212
- #shutil.copyfile(DB_FILE, "./reviews2.db")
213
- #db = sqlite3.connect(DB_FILE)
214
- #reviews = db.execute("SELECT * FROM reviews").fetchall()
215
- pd.DataFrame(reviews).to_csv("./reviews2.csv", index=False)
216
- print("updating db csv")
217
- dataset = load_dataset("csv", data_files="./reviews2.csv")
218
- repo.push_to_hub("CognitiveScience/csdhdata", blocking=False) #, commit_message=f"Updating data-csv at {datetime.datetime.now()}")
219
- #path1=hf_hub_url()
220
- #print (path1)
221
- #hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.csv")
222
- #hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.db")
223
- #hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.md")
224
- #hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.md")
225
 
226
 
227
  #def load_data2():
 
200
  #run_code()
201
  #demo.load(get_latest_reviews, celsci, [data, count])
202
  #return "Hello " + name + "!"
203
+ #def backup_db():
204
+ # #shutil.copyfile(DB_FILE, "./reviews.db")
205
+ # #db = sqlite3.connect(DB_FILE)
206
+ # #reviews = db.execute("SELECT * FROM reviews").fetchall()
207
+ # pd.DataFrame(reviews).to_csv("./reviews.csv", index=False)
208
+ # print("updating db")
209
+ # repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
210
 
211
+ #def backup_db_csv():
212
+ # #shutil.copyfile(DB_FILE, "./reviews2.db")
213
+ # #db = sqlite3.connect(DB_FILE)
214
+ # #reviews = db.execute("SELECT * FROM reviews").fetchall()
215
+ # pd.DataFrame(reviews).to_csv("./reviews2.csv", index=False)
216
+ # print("updating db csv")
217
+ # dataset = load_dataset("csv", data_files="./reviews2.csv")
218
+ # repo.push_to_hub("CognitiveScience/csdhdata", blocking=False) #, commit_message=f"Updating data-csv at {datetime.datetime.now()}")
219
+ # #path1=hf_hub_url()
220
+ # #print (path1)
221
+ # #hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.csv")
222
+ # #hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.db")
223
+ # #hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.md")
224
+ # #hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.md")
225
 
226
 
227
  #def load_data2():