LiamKhoaLe commited on
Commit
331c413
·
1 Parent(s): 4cf6c84

Upd subtree reproduction cd

Browse files
Files changed (1) hide show
  1. push-hf.sh +31 -0
push-hf.sh ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Script to push backend to HuggingFace from the backend directory
4
+ # This script should be run from the backend directory
5
+ # Usage: ./push-to-hf.sh
6
+
7
+ echo "🚀 Pushing backend to HuggingFace Spaces..."
8
+
9
+ # Go to root directory
10
+ cd ..
11
+
12
+ # Create a new subtree split for backend
13
+ git subtree split --prefix=backend -b backend-hf-$(date +%Y%m%d-%H%M%S)
14
+
15
+ # Get the latest branch name
16
+ LATEST_BRANCH=$(git branch | grep "backend-hf-" | tail -1 | sed 's/^..//')
17
+
18
+ echo "📦 Created branch: $LATEST_BRANCH"
19
+
20
+ # Push to HuggingFace
21
+ git push hf $LATEST_BRANCH:main --force
22
+
23
+ echo "✅ Backend successfully pushed to HuggingFace Spaces!"
24
+ echo "🔗 View at: https://huggingface.co/spaces/BinKhoaLe1812/Cooking_Tutor"
25
+
26
+ # Clean up the temporary branch
27
+ git branch -D $LATEST_BRANCH
28
+ echo "🧹 Cleaned up temporary branch: $LATEST_BRANCH"
29
+
30
+ # Return to backend directory
31
+ cd backend