CognitiveScience commited on
Commit
24b739e
1 Parent(s): 3f05da9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -131,7 +131,7 @@ with gr.Blocks(css=css) as demo:
131
  load_data()
132
  #return "Hello " + name + "!"
133
  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("./reviews.csv", index=False)
@@ -139,17 +139,17 @@ def backup_db():
139
  repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
140
 
141
  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="./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)
151
- #hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.csv")
152
- #hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.csv")
153
  #hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.db")
154
  #hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.db")
155
 
 
131
  load_data()
132
  #return "Hello " + name + "!"
133
  def backup_db():
134
+ shutil.copyfile(DB_FILE, "./reviews.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)
 
139
  repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
140
 
141
  def backup_db_csv():
142
+ shutil.copyfile(DB_FILE, "./reviews.db")
143
  db = sqlite3.connect(DB_FILE)
144
  reviews = db.execute("SELECT * FROM reviews").fetchall()
145
+ pd.DataFrame(reviews).to_csv("./reviews.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)
151
+ hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.csv")
152
+ hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.csv")
153
  #hf_hub_download(repo_id="CogSphere/aCogSphere", filename="./*.db")
154
  #hf_hub_download(repo_id="CognitiveScience/csdhdata", filename="./*.db")
155