showgan's picture
Training in progress, step 1000
09b13b3 verified
raw
history blame
402 Bytes
from typing import Optional
from huggingface_hub import HfFolder, whoami
def get_full_repo_name(model_id: str, organization: Optional[str] = None, token: Optional[str] = None):
if token is None:
token = HfFolder.get_token()
if organization is None:
username = whoami(token)["name"]
return f"{username}/{model_id}"
else:
return f"{organization}/{model_id}"