Skip to content

Commit

Permalink
fix test on push
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoangthuan99 committed Aug 9, 2024
1 parent bcce433 commit 51701f2
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/convert-model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5.1.1 # v5.1.1
uses: actions/setup-python@v4 # v5.1.1
with:
python-version: '3.10'
# architecture: 'x64'
Expand All @@ -63,7 +63,7 @@ jobs:
run: |
# python.exe -m ensurepip
# python.exe -m pip install --upgrade pip
pip3 install huggingface_hub hf-transfer numpy==1.26.4 torch==2.3.1 transformers==4.43.4 onnx==1.16.1 onnxruntime==1.18.0 sentencepiece==0.2.0
pip3 install -I huggingface_hub hf-transfer numpy==1.26.4 torch==2.3.1 transformers==4.43.4 onnx==1.16.1 onnxruntime==1.18.0 sentencepiece==0.2.0
# if ($env:EXECUTOR -eq 'cpu') { fire
# pip install --pre onnxruntime-genai=="$env:ONNXRUNTIME_GENAI_VERSION"
Expand Down Expand Up @@ -109,28 +109,27 @@ jobs:
restore-keys: |
{{ runner.os }}-hf-model-
# - name: Download Hugging Face model
# run: |
# 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 logout
- name: Download Hugging Face model
run: |
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 logout
- 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 "${{ env.MODEL_NAME }}/hf" -o "${{ env.MODEL_NAME }}/onnx" -p ${{ env.PRECISION }} -e ${{ env.EXECUTOR }}
python3 .\onnxruntime-genai\src\python\py\models\builder.py -m "T:\Meta-Llama3-8B-Instruct\" -o C:\Users\jan\alex\llama3.1 -p int4 -e dml
python3 "onnxruntime-genai/src/python/py/models/builder.py" -i "${{ env.MODEL_NAME }}/hf" -o "${{ env.MODEL_NAME }}/onnx" -p ${{ env.PRECISION }} -e ${{ env.EXECUTOR }}
huggingface-cli logout
- name: Upload to Hugging Face
run: |
Get-ChildItem -Path "${{ 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:\Users\jan\alex\llama3.1 . --revision "${{ env.SOURCE_MODEL_SIZE }}-onnx"
huggingface-cli upload ${{ env.USER_NAME }}/${{ env.TARGET_MODEL_ID }} "${{ env.MODEL_NAME }}/onnx" . --revision "${{ env.SOURCE_MODEL_SIZE }}-onnx"
huggingface-cli logout
- name: Cleanup
if: always()
run: |
Remove-Item -Recurse -Force -Path "${{ env.MODEL_NAME }}"
# - name: Cleanup
# if: always()
# run: |
# Remove-Item -Recurse -Force -Path "${{ env.MODEL_NAME }}"

0 comments on commit 51701f2

Please sign in to comment.