File size: 554 Bytes
56dc27c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | from huggingface_hub import Repository
# Clone and link to local repo (or use a temp dir)
repo = Repository(local_dir="GabriIT", clone_from="GabriIT/basics")
# Make changes to a file
with open("GabriIT/basics/app.py", "a") as f:
f.write("\nprint('Updated code!')\n")
# Stage, commit, push
repo.git_add(["app.py", "travel_time.py", "README.md", "requirements.txt", "README.md", "READMEexplain.md", "commitHF.py"])
repo.git_commit("app for basics about HF")
repo.git_push()
# Note: Ensure you have the correct permissions to push to the repository. |