1616 PYTHON_VERSION : " 3.10"
1717
1818jobs :
19- # -------------------------------------------------------
20- # Train each model variant in parallel
21- # -------------------------------------------------------
2219 train :
23- name : Train max_length=${{ matrix.max_length }}
20+ name : Train community model
2421 runs-on : [self-hosted, linux, x64, gpu]
25- strategy :
26- matrix :
27- max_length : [512]
2822
2923 steps :
3024 - uses : actions/checkout@v4
@@ -75,37 +69,38 @@ jobs:
7569 run : |
7670 echo "Python:"
7771 which python
78-
72+
7973 echo "CUDA_VISIBLE_DEVICES:"
8074 echo "${CUDA_VISIBLE_DEVICES:-<not set>}"
81-
75+
8276 nvidia-smi
83-
77+
8478 python - <<'PY'
8579 import torch
8680 import transformers
8781 import accelerate
88-
82+
8983 print("PyTorch:", torch.__version__)
9084 print("Transformers:", transformers.__version__)
9185 print("Accelerate:", accelerate.__version__)
9286 print("CUDA available:", torch.cuda.is_available())
9387 print("CUDA runtime:", torch.version.cuda)
9488 print("GPU count:", torch.cuda.device_count())
95-
89+
9690 if torch.cuda.is_available():
9791 print("GPU:", torch.cuda.get_device_name(0))
98-
92+
9993 assert torch.cuda.is_available(), "CUDA unavailable inside GitHub Actions"
10094 PY
10195
10296 - name : Train model
10397 run : |
104- MAXLEN=${{ matrix.max_length }}
98+ MAXLEN=512
10599 VERSION="${{ github.event.inputs.rel_version }}"
106- MODEL_DIR="community_model_${MAXLEN} "
100+ MODEL_DIR="community_model "
107101 ONNX_DIR="${MODEL_DIR}_onnx"
108- ZIP_NAME="intent-model-community-${MAXLEN}.zip"
102+ ZIP_NAME="intent-model-community.zip"
103+
109104 echo "Training community model with max_length=$MAXLEN (version $VERSION)"
110105
111106 python src/train_intent_classifier.py \
@@ -118,57 +113,47 @@ jobs:
118113 --output_dir "$MODEL_DIR" \
119114 --onnx_output_dir "$ONNX_DIR"
120115
121- # Build release folder
122-
123116 python src/generate_labels_json.py "$ONNX_DIR"
124-
117+
125118 mkdir -p release_temp
126119 cp "$ONNX_DIR/model.onnx" release_temp/
127120 cp "$MODEL_DIR/vocab.txt" release_temp/
128121 cp "$ONNX_DIR/metadata.json" release_temp/
129122 cp "$ONNX_DIR/labels.json" release_temp/
130123
131- # Create release artifact directory and zip
132124 mkdir -p release_artifacts
133125 (cd release_temp && zip -r "../release_artifacts/$ZIP_NAME" .)
134126
135- # Clean up temporary directories (keep only the zip)
136127 rm -rf release_temp "$MODEL_DIR" "$ONNX_DIR"
137128
138129 - name : Upload trained model artifact
139130 uses : actions/upload-artifact@v4
140131 with :
141- name : model-community-${{ matrix.max_length }}
142- path : release_artifacts/intent-model-community-${{ matrix.max_length }} .zip
132+ name : model-community
133+ path : release_artifacts/intent-model-community.zip
143134
144- # -------------------------------------------------------
145- # Collect all artifacts, checksum, and publish release
146- # -------------------------------------------------------
147135 release :
148136 name : Create GitHub Release
149137 runs-on : ubuntu-latest
150- needs : train # waits for all matrix jobs to complete
138+ needs : train
151139
152140 steps :
153- - name : Download all model artifacts
141+ - name : Download model artifact
154142 uses : actions/download-artifact@v4
155143 with :
144+ name : model-community
156145 path : release_artifacts
157- pattern : model-community-*
158- merge-multiple : true # flattens all files into release_artifacts/
159146
160- - name : Generate checksums
147+ - name : Generate checksum
161148 run : |
162149 cd release_artifacts
163- for file in *.zip; do
164- sha256sum "$file" > "$file.sha256"
165- done
150+ sha256sum intent-model-community.zip > intent-model-community.zip.sha256
166151
167152 - name : Create GitHub Release
168153 uses : softprops/action-gh-release@v2
169154 with :
170155 tag_name : ${{ github.event.inputs.rel_version }}
171156 name : Intent Models CE ${{ github.event.inputs.rel_version }}
172157 files : |
173- release_artifacts/intent-model-community-* .zip
174- release_artifacts/intent-model-community-* .zip.sha256
158+ release_artifacts/intent-model-community.zip
159+ release_artifacts/intent-model-community.zip.sha256
0 commit comments