CognitiveScience commited on
Commit
039819f
1 Parent(s): 0937ada

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -22
app.py CHANGED
@@ -83,14 +83,7 @@ def run_actr():
83
  env.model2=ProceduralPlayer()
84
  env.model2.choice=env.choice2
85
  env.run()
86
- db = sqlite3.connect(DB_FILE)
87
- cursor = db.cursor()
88
- cursor.execute("INSERT INTO reviews(name, rate, celsci) VALUES(?,?,?)", ["name", 0, "celsci"])
89
- db.commit()
90
- reviews, total_reviews = get_latest_reviews(db)
91
- db.close()
92
- #demo.load()
93
- return reviews, total_reviews
94
 
95
  def load_data():
96
  db = sqlite3.connect(DB_FILE)
@@ -105,14 +98,6 @@ with gr.Blocks(css=css) as demo:
105
  with gr.Column():
106
  data = gr.Dataframe()
107
  count = gr.Number(label="Rates!")
108
- def refre():
109
- demo.load(ccogsphere, ["name", 0, "celsci"], [data, count])
110
-
111
- scheduler = BackgroundScheduler()
112
- scheduler.add_job(func=refre, trigger="interval", seconds=10)
113
- scheduler.start()
114
- #with gr.Box():
115
- #gr.Markdown("Based on dataset [here](https://huggingface.co/datasets/freddyaboulton/gradio-reviews)")
116
  with gr.Row():
117
  with gr.Column():
118
  name = gr.Textbox(label="a") #, placeholder="What is your name?")
@@ -139,12 +124,12 @@ def backup_db():
139
  print("updating db")
140
  repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
141
 
142
- def load_data2():
143
- db = sqlite3.connect(DB_FILE)
144
- reviews, total_reviews = get_latest_reviews(db)
145
- #db.close()
146
- demo.load(load_data,None, [reviews, total_reviews])
147
- #return reviews, total_reviews
148
 
149
  scheduler2 = BackgroundScheduler()
150
  scheduler2.add_job(func=run_actr, trigger="interval", seconds=10)
 
83
  env.model2=ProceduralPlayer()
84
  env.model2.choice=env.choice2
85
  env.run()
86
+
 
 
 
 
 
 
 
87
 
88
  def load_data():
89
  db = sqlite3.connect(DB_FILE)
 
98
  with gr.Column():
99
  data = gr.Dataframe()
100
  count = gr.Number(label="Rates!")
 
 
 
 
 
 
 
 
101
  with gr.Row():
102
  with gr.Column():
103
  name = gr.Textbox(label="a") #, placeholder="What is your name?")
 
124
  print("updating db")
125
  repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
126
 
127
+ #def load_data2():
128
+ # db = sqlite3.connect(DB_FILE)
129
+ # reviews, total_reviews = get_latest_reviews(db)
130
+ # #db.close()
131
+ # demo.load(load_data,None, [reviews, total_reviews])
132
+ # #return reviews, total_reviews
133
 
134
  scheduler2 = BackgroundScheduler()
135
  scheduler2.add_job(func=run_actr, trigger="interval", seconds=10)