CognitiveScience commited on
Commit
e74f020
1 Parent(s): bd6f558

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -16,7 +16,7 @@ from apscheduler.schedulers.background import BackgroundScheduler
16
  import random
17
  import time
18
 
19
- DB_FILE = "./reviews.db"
20
 
21
  TOKEN = os.environ.get('HF_KEY')
22
 
@@ -29,7 +29,7 @@ repo = huggingface_hub.Repository(
29
  repo.git_pull()
30
 
31
  # Set db to latest
32
- #shutil.copyfile("./data/reviews.db", DB_FILE)
33
 
34
  # Create table if it doesn't already exist
35
 
@@ -69,8 +69,9 @@ def load_data():
69
  reviews, total_reviews = get_latest_reviews(db)
70
  db.close()
71
  return reviews, total_reviews
 
72
 
73
- with gr.Blocks(api_name=["/ccogsphere"]) as demo:
74
  with gr.Row():
75
  with gr.Column():
76
  #with gr.Box():
@@ -94,7 +95,7 @@ with gr.Blocks(api_name=["/ccogsphere"]) as demo:
94
  #return "Hello " + name + "!"
95
 
96
  def backup_db():
97
- shutil.copyfile(DB_FILE, "./data/reviews.db")
98
  db = sqlite3.connect(DB_FILE)
99
  reviews = db.execute("SELECT * FROM reviews").fetchall()
100
  pd.DataFrame(reviews).to_csv("./reviews.csv", index=False)
 
16
  import random
17
  import time
18
 
19
+ DB_FILE = "./reviews1.db"
20
 
21
  TOKEN = os.environ.get('HF_KEY')
22
 
 
29
  repo.git_pull()
30
 
31
  # Set db to latest
32
+ shutil.copyfile("./reviews.db", DB_FILE)
33
 
34
  # Create table if it doesn't already exist
35
 
 
69
  reviews, total_reviews = get_latest_reviews(db)
70
  db.close()
71
  return reviews, total_reviews
72
+ css="footer {visibility: hidden}"
73
 
74
+ with gr.Blocks(css=css,api_name=["/ccogsphere"]) as demo:
75
  with gr.Row():
76
  with gr.Column():
77
  #with gr.Box():
 
95
  #return "Hello " + name + "!"
96
 
97
  def backup_db():
98
+ shutil.copyfile(DB_FILE, "./reviews1.db")
99
  db = sqlite3.connect(DB_FILE)
100
  reviews = db.execute("SELECT * FROM reviews").fetchall()
101
  pd.DataFrame(reviews).to_csv("./reviews.csv", index=False)