File tree Expand file tree Collapse file tree 6 files changed +35
-4
lines changed
Expand file tree Collapse file tree 6 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 3232 description : " Whether the test range is CI, CD or CICD"
3333 required : false
3434 type : string
35+ use_model_cache :
36+ default : false
37+ description : " use model cache true or false"
38+ required : false
39+ type : boolean
3540
3641jobs :
3742 # ###################################################################################################
@@ -111,6 +116,7 @@ jobs:
111116 with :
112117 tag : ${{ inputs.tag }}
113118 service : ${{ inputs.service }}
119+ use_model_cache : ${{ inputs.use_model_cache }}
114120 secrets : inherit
115121
116122 # ###################################################################################################
Original file line number Diff line number Diff line change 2020 description : Example to test
2121 required : true
2222 type : string
23+ use_model_cache :
24+ default : false
25+ required : false
26+ type : boolean
27+
2328jobs :
2429 get-test-case :
2530 runs-on : ubuntu-latest
@@ -96,10 +101,19 @@ jobs:
96101 service : ${{ inputs.service }}
97102 test_case : ${{ matrix.test_case }}
98103 hardware : ${{ matrix.hardware }}
104+ use_model_cache : ${{ inputs.use_model_cache }}
99105 run : |
100106 cd ${{ github.workspace }}/tests
101107 service=$(echo "${test_case}" | cut -d'/' -f3 | cut -d'_' -f2- |cut -d'.' -f1)
102108 echo "service=${service}" >> $GITHUB_ENV
109+ if [[ "$use_model_cache" == "true" ]]; then
110+ if [ -d "/data2/hf_model" ]; then
111+ export model_cache="/data2/hf_model"
112+ else
113+ echo "Model cache directory /data2/huggingface does not exist"
114+ export model_cache="~/.cache/huggingface/hub"
115+ fi
116+ fi
103117 if [ -f ${test_case} ]; then timeout 60m bash ${test_case}; else echo "Test script {${test_case}} not found, skip test!"; fi
104118
105119 - name : Clean up container
Original file line number Diff line number Diff line change 3535 description : " Whether the test range is CI, CD or CICD"
3636 required : false
3737 type : string
38+ use_model_cache :
39+ default : false
40+ description : " use model cache true or false"
41+ required : false
42+ type : boolean
3843
3944permissions : read-all
4045
Original file line number Diff line number Diff line change 7676 run : |
7777 cd tests
7878 echo "log_name=${service}" >> $GITHUB_ENV
79+ if [ -d "/data2/hf_model" ]; then
80+ export model_cache="/data2/hf_model"
81+ else
82+ echo "Model cache directory /data2/huggingface does not exist"
83+ export model_cache="~/.cache/huggingface/hub"
84+ fi
7985 timeout 60m bash $(find . -type f -name test_${service}.sh)
8086
8187 - name : Clean up container
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /bin/bash
22# Copyright (C) 2024 Intel Corporation
33# SPDX-License-Identifier: Apache-2.0
44
77WORKPATH=$( dirname " $PWD " )
88LOG_PATH=" $WORKPATH /tests"
99ip_address=$( hostname -I | awk ' {print $1}' )
10- DATA_PATH=$WORKPATH /data
10+ export DATA_PATH=${model_cache :- . / data}
1111
1212export TAG=' comps'
1313
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /bin/bash
22# Copyright (C) 2024 Intel Corporation
33# SPDX-License-Identifier: Apache-2.0
44
@@ -8,7 +8,7 @@ WORKPATH=$(dirname "$PWD")
88LOG_PATH=" $WORKPATH /tests"
99ip_address=$( hostname -I | awk ' {print $1}' )
1010
11- export DATA_PATH=$WORKPATH /data
11+ export DATA_PATH=${model_cache :- . / data}
1212
1313export TAG=' comps'
1414
You can’t perform that action at this time.
0 commit comments