Skip to content

Commit

Permalink
test: CI convert llama3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoangthuan99 committed Aug 11, 2024
1 parent edc23d9 commit cd793e7
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/convert-model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cd793e7

Please sign in to comment.