Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save atrisovic/4e68ebfc1841c60fb87bf83bfb220361 to your computer and use it in GitHub Desktop.
Save atrisovic/4e68ebfc1841c60fb87bf83bfb220361 to your computer and use it in GitHub Desktop.
zach
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