Created
June 8, 2024 15:33
-
-
Save atrisovic/4e68ebfc1841c60fb87bf83bfb220361 to your computer and use it in GitHub Desktop.
zach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from huggingface_hub import HfApi | |
import datetime | |
import json | |
df = pd.read_csv('../../data/llm_leaderboard.csv', index_col=1, header=1) | |
def get_model_info(model_id): | |
api = HfApi() | |
try: | |
model_info = api.model_info(model_id) | |
creation_date = model_info.created_at.date() | |
last_modified_date = model_info.last_modified.date() | |
return creation_date, last_modified_date | |
except Exception as e: | |
# print(f"Failed to get model info for {model_id}: {e}") | |
return None, None | |
df['creation_date'], df['last_modified'] = zip(*df['Creator/Model'].apply(get_model_info)) | |
df.to_csv('../../data/llm_leaderboard_with_dates.csv', index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment