appstore / app /models /upload.py
notes73
Initial project upload
6410a28
raw
history blame contribute delete
387 Bytes
from huggingface_hub import HfApi
def upload_model_to_hf(model_name, description, tags, file):
api = HfApi()
api.upload_file(
path_or_fileobj=file,
path_in_repo=model_name,
repo_id="your-huggingface-repo",
repo_type="model",
commit_message=f"Added {model_name}",
commit_description=description,
tags=tags.split(","),
)