emotion-detection / upload_model.py
saeedbenadeeb's picture
First commit
0874d87
raw
history blame contribute delete
423 Bytes
from huggingface_hub import HfApi, HfFolder, Repository
api = HfApi()
repo_url = api.create_repo(repo_id="saeedbenadeeb/emotion-detection", exist_ok=True)
repo = Repository(local_dir="emotion-detection", clone_from=repo_url)
repo.git_pull()
# Copy model files to the repo directory
import shutil
shutil.copy("model.pth", "emotion-detection")
# Add files and push
repo.push_to_hub(commit_message="Initial model upload")