Monish Vijay Kumar commited on
Commit
bc7d77f
·
1 Parent(s): 7056be6

changed dependency

Browse files
Files changed (2) hide show
  1. README.md +5 -4
  2. scripts/prepare_hf_deploy.sh +4 -21
README.md CHANGED
@@ -43,13 +43,14 @@ After pushing, HF builds the image and serves on port **7860**. First query load
43
 
44
  ### Push updates
45
 
 
 
46
  ```bash
47
  cd kiosk_vanilla
48
- git lfs install
49
  git add -A
50
- git status # confirm models/best.pt is tracked by LFS
51
- git commit -m "Deploy vanilla kiosk with checkpoint and inference bundle"
52
- git push origin main
53
  ```
54
 
55
  ## Environment (set in Dockerfile)
 
43
 
44
  ### Push updates
45
 
46
+ Develop in this repo (`kiosk_vanilla/`). After retraining or code changes:
47
+
48
  ```bash
49
  cd kiosk_vanilla
50
+ ./scripts/prepare_hf_deploy.sh # refresh best.pt + tokenizer + MSAI runtime
51
  git add -A
52
+ git commit -m "Update kiosk"
53
+ git push "https://monish563:$(hf auth token)@huggingface.co/spaces/monish563/kiosk_vanilla" main
 
54
  ```
55
 
56
  ## Environment (set in Dockerfile)
scripts/prepare_hf_deploy.sh CHANGED
@@ -1,9 +1,8 @@
1
  #!/usr/bin/env bash
2
- # Sync kiosk_vanilla_dev + minimal inference runtime into this HF Space repo.
3
  set -euo pipefail
4
 
5
  ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
6
- DEV="$ROOT/kiosk_vanilla_dev"
7
  HF="$ROOT/kiosk_vanilla"
8
  MSAI="$ROOT/MSAI_Text_Generation"
9
 
@@ -26,25 +25,11 @@ RUNTIME_FILES=(
26
  src/model/transformer.py
27
  )
28
 
29
- if [[ ! -d "$DEV" || ! -f "$MSAI/checkpoints/best.pt" ]]; then
30
- echo "Expected kiosk_vanilla_dev and MSAI_Text_Generation/checkpoints/best.pt." >&2
31
  exit 1
32
  fi
33
 
34
- rsync -a \
35
- --exclude '.git' \
36
- --exclude '.venv' \
37
- --exclude '.env' \
38
- --exclude 'node_modules' \
39
- --exclude 'frontend/node_modules' \
40
- --exclude 'frontend/dist' \
41
- --exclude 'backend/storage/*.jsonl' \
42
- --exclude 'models/best.pt' \
43
- --exclude 'models/tokenizer' \
44
- --exclude 'MSAI_Text_Generation' \
45
- --exclude '.DS_Store' \
46
- "$DEV/" "$HF/"
47
-
48
  mkdir -p "$HF/models" "$HF/MSAI_Text_Generation" "$HF/backend/storage"
49
  cp "$MSAI/checkpoints/best.pt" "$HF/models/best.pt"
50
  rm -rf "$HF/models/tokenizer"
@@ -58,10 +43,8 @@ for rel in "${RUNTIME_FILES[@]}"; do
58
  cp "$MSAI/$rel" "$HF/MSAI_Text_Generation/$rel"
59
  done
60
 
61
- rm -f "$HF/Archive/Archive"
62
  touch "$HF/backend/storage/.gitkeep"
63
 
64
- echo "HF deploy tree ready at $HF"
65
  echo "Checkpoint: $(ls -lh "$HF/models/best.pt" | awk '{print $5, $6, $7, $8}')"
66
  echo "Tokenizer: $(ls -lh "$HF/models/tokenizer/tokenizer.json" | awk '{print $5, $6, $7, $8}')"
67
- echo "MSAI runtime files: ${#RUNTIME_FILES[@]}"
 
1
  #!/usr/bin/env bash
2
+ # Refresh model weights + minimal MSAI inference runtime in this repo.
3
  set -euo pipefail
4
 
5
  ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
 
6
  HF="$ROOT/kiosk_vanilla"
7
  MSAI="$ROOT/MSAI_Text_Generation"
8
 
 
25
  src/model/transformer.py
26
  )
27
 
28
+ if [[ ! -f "$MSAI/checkpoints/best.pt" ]]; then
29
+ echo "Expected MSAI_Text_Generation/checkpoints/best.pt." >&2
30
  exit 1
31
  fi
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  mkdir -p "$HF/models" "$HF/MSAI_Text_Generation" "$HF/backend/storage"
34
  cp "$MSAI/checkpoints/best.pt" "$HF/models/best.pt"
35
  rm -rf "$HF/models/tokenizer"
 
43
  cp "$MSAI/$rel" "$HF/MSAI_Text_Generation/$rel"
44
  done
45
 
 
46
  touch "$HF/backend/storage/.gitkeep"
47
 
48
+ echo "Refreshed weights + MSAI runtime in $HF"
49
  echo "Checkpoint: $(ls -lh "$HF/models/best.pt" | awk '{print $5, $6, $7, $8}')"
50
  echo "Tokenizer: $(ls -lh "$HF/models/tokenizer/tokenizer.json" | awk '{print $5, $6, $7, $8}')"