Spaces:
Runtime error
Runtime error
deema
commited on
Commit
•
69311a6
1
Parent(s):
c42e6da
code clean up
Browse files- app.py +0 -5
- database.py +0 -23
app.py
CHANGED
@@ -42,11 +42,6 @@ def process_rankings(user_rankings):
|
|
42 |
save_response(model_rankings_dict)
|
43 |
print("Updated Model Rankings:", model_rankings) # Debugging print
|
44 |
return
|
45 |
-
# file_path = 'users_ranking.txt'
|
46 |
-
# with open(file_path, 'a') as file:
|
47 |
-
# model_rankings_dict = dict(model_rankings)
|
48 |
-
# json.dump(model_rankings_dict, file)
|
49 |
-
# file.write('\n') # Add a newline to separate entries
|
50 |
|
51 |
|
52 |
def get_questions_and_answers():
|
|
|
42 |
save_response(model_rankings_dict)
|
43 |
print("Updated Model Rankings:", model_rankings) # Debugging print
|
44 |
return
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
|
47 |
def get_questions_and_answers():
|
database.py
CHANGED
@@ -9,29 +9,6 @@ db = client['testDB']
|
|
9 |
collection = db['testCol']
|
10 |
|
11 |
|
12 |
-
################################################
|
13 |
-
|
14 |
-
# from pymongo.mongo_client import MongoClient
|
15 |
-
# from pymongo.server_api import ServerApi
|
16 |
-
# from urllib.parse import quote_plus
|
17 |
-
# # import ssl
|
18 |
-
# from pymongo import MongoClient
|
19 |
-
|
20 |
-
# uri = "mongodb+srv://cluster0.tzvxqk3.mongodb.net/?authSource=%24external&authMechanism=MONGODB-X509&retryWrites=true&w=majority"
|
21 |
-
# client = MongoClient(uri,
|
22 |
-
# tls=True,
|
23 |
-
# tlsCertificateKeyFile='/Users/deemaalnuhait/research/hf/cidar_human_eval/X509-cert-2433626168795922546.pem')
|
24 |
-
|
25 |
-
# password = quote_plus('cidar@2024$')
|
26 |
-
# uri = f"mongodb+srv://deemaa2:{password}@cluster0.qjruxcb.mongodb.net/?retryWrites=true&w=majority"
|
27 |
-
|
28 |
-
# # Create a new client and connect to the server
|
29 |
-
# client = MongoClient(uri, server_api=ServerApi('1'))
|
30 |
-
|
31 |
-
# # Specify the database and collection
|
32 |
-
# db = client.your_database_name
|
33 |
-
# collection = db.your_collection_name
|
34 |
-
|
35 |
def save_response(response_data):
|
36 |
"""Saves a response to the MongoDB collection."""
|
37 |
|
|
|
9 |
collection = db['testCol']
|
10 |
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
def save_response(response_data):
|
13 |
"""Saves a response to the MongoDB collection."""
|
14 |
|