Commit
·
1dbc6c6
1
Parent(s):
bc368a6
Initial commit for Hugging Face
Browse files
scripts/upload_to_huggingface.py
CHANGED
|
@@ -281,9 +281,14 @@ def upload_to_huggingface(repo_path: Path, repo_name: str, private: bool = False
|
|
| 281 |
subprocess.run(["git", "remote", "add", "origin", remote_url], check=True)
|
| 282 |
print(f" Added remote: {remote_url}")
|
| 283 |
|
| 284 |
-
#
|
| 285 |
-
subprocess.run(["git", "
|
| 286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
|
| 288 |
print(f"\n🎉 Successfully uploaded to: https://huggingface.co/{repo_id}")
|
| 289 |
return True
|
|
|
|
| 281 |
subprocess.run(["git", "remote", "add", "origin", remote_url], check=True)
|
| 282 |
print(f" Added remote: {remote_url}")
|
| 283 |
|
| 284 |
+
# Get current branch name
|
| 285 |
+
result = subprocess.run(["git", "branch", "--show-current"],
|
| 286 |
+
capture_output=True, text=True, check=True)
|
| 287 |
+
current_branch = result.stdout.strip()
|
| 288 |
+
|
| 289 |
+
# Push to Hugging Face using current branch
|
| 290 |
+
subprocess.run(["git", "push", "-u", "origin", current_branch], check=True)
|
| 291 |
+
print(f" Pushed to Hugging Face (branch: {current_branch})")
|
| 292 |
|
| 293 |
print(f"\n🎉 Successfully uploaded to: https://huggingface.co/{repo_id}")
|
| 294 |
return True
|