GEMRec-Gallery / data /ranking_script.py
Ricercar's picture
add connections to database
c8f09d8
raw
history blame
No virus
569 Bytes
from datasets import Dataset
from datetime import datetime
def init_ranking_data():
ds = Dataset.from_dict({'image_id': [], 'modelVersion_id': [], 'ranking': [], "user_name": [], "timestamp": []})\
# add example data
# note that image_id is a string, other ids are int
ds = ds.add_item({'image_id': '0', 'modelVersion_id': 0, 'ranking': 0, "user_name": "example_data", "timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S")})
ds.push_to_hub("MAPS-research/GEMRec-Ranking", split='train')
if __name__ == '__main__':
init_ranking_data()