HF
Utilities to manage HF Hub model hosting
create_repository
create_repository (repo_name:str, private:bool=False)
Create a repository on the Hugging Face Hub.
upload_model_file
upload_model_file (repo_name:str, file_path:str, path_in_repo:str=None)
Upload a model file to the Hugging Face Hub.
upload_readme
upload_readme (repo_name:str, readme_path:str)
Upload a README.md file to the Hugging Face Hub.
download_model_file
download_model_file (repo_name:str, file_name:str, save_path:str)
Download a file from the Hugging Face Hub.
load_model
load_model (file_path:str, model_class)
Load a PyTorch model from a file.
list_files_in_repo
list_files_in_repo (repo_name:str)
List all files in a Hugging Face repository.
delete_file_in_repo
delete_file_in_repo (repo_name:str, file_path:str)
Delete a file from a Hugging Face repository.
clone_repository
clone_repository (repo_name:str, local_path:str)
Clone a Hugging Face repository locally.
save_and_upload_model
save_and_upload_model (repo_name:str, model, file_path:str, path_in_repo:str=None, readme_path:str=None)
Save a PyTorch model and upload it to Hugging Face.
generate_readme
generate_readme (metadata:dict)
Generate a README.md file content with YAML front matter based on the provided metadata.