diff --git a/.github/workflows/convert-model.yml b/.github/workflows/convert-model.yml index b229da3..cb7eceb 100644 --- a/.github/workflows/convert-model.yml +++ b/.github/workflows/convert-model.yml @@ -114,32 +114,26 @@ jobs: mkdir -p C:\\models\\${{ env.MODEL_NAME }}/onnx mkdir -p C:\\models\\${{ env.MODEL_NAME }}/cache huggingface-cli login --token ${{ secrets.HUGGINGFACE_TOKEN_READ }} --add-to-git-credential - huggingface-cli download --repo-type model --local-dir ${{ env.MODEL_NAME }}/hf ${{ env.SOURCE_MODEL_ID }} + huggingface-cli download --repo-type model --local-dir C:\\models\\${{ env.MODEL_NAME }}/hf ${{ env.SOURCE_MODEL_ID }} + echo %ERRORLEVEL% huggingface-cli logout - - name: Remove Failure Download - if: steps.download_hf.outcome == 'failure' - run: | - Remove-Item -Recurse -Force -Path "$C:\\models\\{{ env.MODEL_NAME }}" + # - name: Remove Failure Download + # if: steps.download_hf.outcome == 'failure' + # run: | + # Remove-Item -Recurse -Force -Path "$C:\\models\\{{ env.MODEL_NAME }}" - # - name: Cache Hugging Face model - # uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 - # with: - # path: ${{ env.MODEL_NAME }}/hf - # key: ${{ runner.os }}-hf-model-${{ github.sha }} - # restore-keys: | - # {{ runner.os }}-hf-model- - name: Convert to ONNX - DirectML - INT4 shell: powershell run: | huggingface-cli login --token ${{ secrets.HUGGINGFACE_TOKEN_READ }} --add-to-git-credential - python3 "onnxruntime-genai/src/python/py/models/builder.py" -i "C:\\models\\${{ env.MODEL_NAME }}/hf" -o "C:\\models\\$${{ env.MODEL_NAME }}/onnx" -p ${{ env.PRECISION }} -e ${{ env.EXECUTOR }} + python3 "onnxruntime-genai/src/python/py/models/builder.py" -i "C:\\models\\${{ env.MODEL_NAME }}/hf" -o "C:\\models\\${{ env.MODEL_NAME }}/onnx" -p ${{ env.PRECISION }} -e ${{ env.EXECUTOR }} huggingface-cli logout - name: Upload to Hugging Face run: | - Get-ChildItem -Path "C:\\models\\$${{ env.MODEL_NAME }}/onnx" -Force + Get-ChildItem -Path "C:\\models\\${{ env.MODEL_NAME }}/onnx" -Force huggingface-cli login --token ${{ secrets.HUGGINGFACE_TOKEN_WRITE }} --add-to-git-credential huggingface-cli upload ${{ env.USER_NAME }}/${{ env.TARGET_MODEL_ID }} "C:\\models\\${{ env.MODEL_NAME }}/onnx" . --revision "${{ env.SOURCE_MODEL_SIZE }}-onnx" huggingface-cli logout