Skip to content

Commit 5f9fed0

Browse files
authored
[Feature] Add a workflow parameter that model uploader can specific a customize prefix. (#398)
Signed-off-by: conggguan <[email protected]>
1 parent 3b18ac8 commit 5f9fed0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/model_uploader.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ on:
2424
- "BOTH"
2525
- "TORCH_SCRIPT"
2626
- "ONNX"
27+
upload_prefix:
28+
description: "Specifies the model prefix for uploading. For example, transforming the default path from '.../sentence-transformers/msmarco-distilbert-base-tas-b' to '.../{prefix}/msmarco-distilbert-base-tas-b'."
29+
required: false
30+
type: string
2731
model_type:
2832
description: "Model type for auto-tracing (SentenceTransformer/Sparse)"
2933
required: true
@@ -74,7 +78,12 @@ jobs:
7478
run: |
7579
model_id=${{ github.event.inputs.model_id }}
7680
echo "model_folder=ml-models/${{github.event.inputs.model_source}}/${model_id}" >> $GITHUB_OUTPUT
77-
echo "model_prefix_folder=ml-models/${{github.event.inputs.model_source}}/${model_id%%/*}/" >> $GITHUB_OUTPUT
81+
if [[ -n "${{ github.event.inputs.upload_prefix }}" ]]; then
82+
model_prefix="ml-models/${{ github.event.inputs.model_source }}/${{ github.event.inputs.upload_prefix }}"
83+
else
84+
model_prefix="ml-models/${{ github.event.inputs.model_source }}/${model_id%%/*}"
85+
fi
86+
echo "model_prefix_folder=$model_prefix" >> $GITHUB_OUTPUT
7887
- name: Initiate workflow_info
7988
id: init_workflow_info
8089
run: |

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1717
- Add workflows and scripts for sparse encoding model tracing and uploading process by @conggguan in ([#394](https://github.com/opensearch-project/opensearch-py-ml/pull/394))
1818

1919
### Changed
20+
- Add a parameter for customize the upload folder prefix ([#398](https://github.com/opensearch-project/opensearch-py-ml/pull/398))
2021
- Modify ml-models.JenkinsFile so that it takes model format into account and can be triggered with generic webhook by @thanawan-atc in ([#211](https://github.com/opensearch-project/opensearch-py-ml/pull/211))
2122
- Update demo_tracing_model_torchscript_onnx.ipynb to use make_model_config_json by @thanawan-atc in ([#220](https://github.com/opensearch-project/opensearch-py-ml/pull/220))
2223
- Bump torch from 1.13.1 to 2.0.1 and add onnx dependency by @thanawan-atc ([#237](https://github.com/opensearch-project/opensearch-py-ml/pull/237))

0 commit comments

Comments
 (0)