rayh commited on
Commit
a04bb49
·
1 Parent(s): 8fd2d1a

Deploy latest YOLO model and app (version 20250422.7)

Browse files
Files changed (2) hide show
  1. .gitattributes +1 -0
  2. deploy.sh +18 -4
.gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ weights/*.pt filter=lfs diff=lfs merge=lfs -text
deploy.sh CHANGED
@@ -1,6 +1,6 @@
1
  #!/bin/bash
2
- # Usage: ./deploy.sh <path_to_latest_yolo_train_dir> <hf_space_git_url>
3
- # Example: ./deploy.sh ../yolo-output/models/20250422.7/ https://huggingface.co/spaces/<user>/<space_name>.git
4
 
5
  set -e
6
 
@@ -9,6 +9,9 @@ if [ $# -lt 1 ]; then
9
  exit 1
10
  fi
11
 
 
 
 
12
  MODEL_DIR=$1
13
  [email protected]:spaces/rayh/clusterflux
14
  MODEL_SERVER_DIR=$(dirname "$0")
@@ -25,9 +28,20 @@ VERSION=$(basename "$MODEL_DIR")
25
  echo "$VERSION" > "$MODEL_SERVER_DIR/VERSION"
26
  echo "Set VERSION to $VERSION"
27
 
28
- # Step 3: Deploy to Hugging Face Spaces
29
- echo "Pushing to Hugging Face Space..."
30
  cd "$MODEL_SERVER_DIR"
 
 
 
 
 
 
 
 
 
 
 
 
31
  if [ ! -d .git ]; then
32
  git init
33
  git remote add origin "$HF_SPACE_URL"
 
1
  #!/bin/bash
2
+ # Usage: ./deploy.sh <path_to_latest_yolo_train_dir>
3
+ # Example: ./deploy.sh ../yolo-output/models/20250422.7/
4
 
5
  set -e
6
 
 
9
  exit 1
10
  fi
11
 
12
+ ml git-lfs/3.2.0
13
+
14
+
15
  MODEL_DIR=$1
16
  [email protected]:spaces/rayh/clusterflux
17
  MODEL_SERVER_DIR=$(dirname "$0")
 
28
  echo "$VERSION" > "$MODEL_SERVER_DIR/VERSION"
29
  echo "Set VERSION to $VERSION"
30
 
31
+ # Step 3: Setup Git LFS for .pt files
 
32
  cd "$MODEL_SERVER_DIR"
33
+ if ! git lfs &> /dev/null; then
34
+ echo "Git LFS not found! Please install git-lfs before running this script."
35
+ exit 1
36
+ fi
37
+ git lfs install
38
+ if [ ! -f .gitattributes ] || ! grep -q "weights/*.pt" .gitattributes; then
39
+ git lfs track "weights/*.pt"
40
+ git add .gitattributes
41
+ fi
42
+
43
+ # Step 4: Deploy to Hugging Face Spaces
44
+ echo "Pushing to Hugging Face Space..."
45
  if [ ! -d .git ]; then
46
  git init
47
  git remote add origin "$HF_SPACE_URL"