Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,12 +33,6 @@ async def regenerate_responses(state, chatbot1, chatbot2):
|
|
33 |
return chatbot1, chatbot2
|
34 |
|
35 |
password=os.environ.get("MONGODB")
|
36 |
-
def reset_database():
|
37 |
-
uri = f"mongodb+srv://new-user:{password}@cluster0.xb2urf6.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
|
38 |
-
client = MongoClient(uri)
|
39 |
-
db = client["elo_ratings"]
|
40 |
-
db.drop_collection("elo_ratings")
|
41 |
-
return "Database reset successfully!"
|
42 |
|
43 |
def init_database():
|
44 |
uri = f"mongodb+srv://new-user:{password}@cluster0.xb2urf6.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
|
@@ -309,11 +303,7 @@ with gr.Blocks() as demo:
|
|
309 |
|
310 |
with gr.Row():
|
311 |
refresh_btn = gr.Button("🔄 Refresh Leaderboard")
|
312 |
-
reset_db_btn = gr.Button("🗑️ Reset Database")
|
313 |
|
314 |
-
reset_message = gr.Textbox()
|
315 |
-
|
316 |
-
reset_db_btn.click(reset_database, outputs=[reset_message])
|
317 |
refresh_btn.click(refresh_leaderboard, outputs=[leaderboard])
|
318 |
|
319 |
# Launch the Gradio interface
|
|
|
33 |
return chatbot1, chatbot2
|
34 |
|
35 |
password=os.environ.get("MONGODB")
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
def init_database():
|
38 |
uri = f"mongodb+srv://new-user:{password}@cluster0.xb2urf6.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
|
|
|
303 |
|
304 |
with gr.Row():
|
305 |
refresh_btn = gr.Button("🔄 Refresh Leaderboard")
|
|
|
306 |
|
|
|
|
|
|
|
307 |
refresh_btn.click(refresh_leaderboard, outputs=[leaderboard])
|
308 |
|
309 |
# Launch the Gradio interface
|