CognitiveScience commited on
Commit
a1904cb
1 Parent(s): 0b0b1c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -47
app.py CHANGED
@@ -200,50 +200,4 @@ with gr.Blocks(css=css) as demo:
200
  #run_code()
201
  #demo.load(get_latest_reviews, celsci, [data, count])
202
  #return "Hello " + name + "!"
203
- demo.launch()
204
- #def backup_db():
205
- # #shutil.copyfile(DB_FILE, "./reviews.db")
206
- # #db = sqlite3.connect(DB_FILE)
207
- # #reviews = db.execute("SELECT * FROM reviews").fetchall()
208
- # pd.DataFrame(reviews).to_csv("./reviews.csv", index=False)
209
- # print("updating db")
210
- # repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
211
-
212
- #def backup_db_csv():
213
- # #shutil.copyfile(DB_FILE, "./reviews2.db")
214
- # #db = sqlite3.connect(DB_FILE)
215
- # #reviews = db.execute("SELECT * FROM reviews").fetchall()
216
- # pd.DataFrame(reviews).to_csv("./reviews2.csv", index=False)
217
- # print("updating db csv")
218
- # dataset = load_dataset("csv", data_files="./reviews2.csv")
219
- # repo.push_to_hub("CognitiveScience/csdhdata", blocking=False) #, commit_message=f"Updating data-csv at {datetime.datetime.now()}")
220
- # #path1=hf_hub_url()
221
- # #print (path1)
222
- # #hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.csv")
223
- # #hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.db")
224
- # #hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.md")
225
- # #hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.md")
226
-
227
-
228
- #def load_data2():
229
- # db = sqlite3.connect(DB_FILE)
230
- # reviews, total_reviews = get_latest_reviews(db)
231
- # #db.close()
232
- # demo.load(load_data,None, [reviews, total_reviews])
233
- # #return reviews, total_reviews
234
-
235
- #scheduler1 = BackgroundScheduler()
236
- #scheduler1.add_job(func=run_actr, trigger="interval", seconds=10)
237
- #scheduler1.start()
238
-
239
- #scheduler1 = BackgroundScheduler()
240
- #scheduler1.add_job(func=get_latest_reviews, trigger="interval", seconds=15)
241
- #scheduler1.start()
242
-
243
- #scheduler2 = BackgroundScheduler()
244
- #scheduler2.add_job(func=backup_db, trigger="interval", seconds=3633)
245
- #scheduler2.start()
246
-
247
- #scheduler3 = BackgroundScheduler()
248
- #scheduler3.add_job(func=backup_db_csv, trigger="interval", seconds=3666)
249
- #scheduler3.start()
 
200
  #run_code()
201
  #demo.load(get_latest_reviews, celsci, [data, count])
202
  #return "Hello " + name + "!"
203
+ demo.launch()