From 42ffbeb7f74c40ddf13a68ead26f9fa7ccb6d91d Mon Sep 17 00:00:00 2001 From: Thuandz Date: Sun, 11 Aug 2024 19:27:40 +0700 Subject: [PATCH] test: CI convert llama3.1 --- .github/workflows/convert-model.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/convert-model.yml b/.github/workflows/convert-model.yml index adc3369..f33f9e1 100644 --- a/.github/workflows/convert-model.yml +++ b/.github/workflows/convert-model.yml @@ -25,16 +25,16 @@ on: env: USER_NAME: cortexso - SOURCE_MODEL_ID: google/gemma-2-2b-it #${{ inputs.source_model_id }} - SOURCE_MODEL_SIZE: 2b #${{ inputs.source_model_size }} - TARGET_MODEL_ID: gemma2 #${{ inputs.target_model_id }} + SOURCE_MODEL_ID: meta-llama/Meta-Llama-3-8B-Instruct #${{ inputs.source_model_id }} + SOURCE_MODEL_SIZE: 8b #${{ inputs.source_model_size }} + TARGET_MODEL_ID: llama3.1 #${{ inputs.target_model_id }} PRECISION: int4 # Valid values: int4,fp16,fp3 EXECUTOR: dml # Valid values: cpu,cuda,dml,web ONNXRUNTIME_GENAI_VERSION: 0.3.0 # Check version from: https://github.com/microsoft/onnxruntime-genai/releases jobs: converter: - runs-on: windows-cuda-12-0 + runs-on: windows-onnx steps: - name: Checkout uses: actions/checkout@v4 # v4.1.7 @@ -95,16 +95,19 @@ jobs: echo "EXECUTOR: ${{ env.EXECUTOR }}" echo "MODEL_NAME: ${{ env.MODEL_NAME }}" - - name: Prepare folders - run: | - mkdir -p ${{ env.MODEL_NAME }}/hf - mkdir -p ${{ env.MODEL_NAME }}/onnx - mkdir -p ${{ env.MODEL_NAME }}/cache - + # - name: Prepare folders + # run: | + # mkdir -p C:\\models\\$${{ env.MODEL_NAME }}/hf + # mkdir -p C:\\models\\$${{ env.MODEL_NAME }}/onnx + # mkdir -p C:\\models\\$${{ env.MODEL_NAME }}/cache - name: Download Hugging Face model + if: ${{ hashFiles("C:\\models\\$${{ env.MODEL_NAME }}/hf") != '' }} run: | + mkdir -p C:\\models\\$${{ env.MODEL_NAME }}/hf + 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 logout @@ -121,14 +124,14 @@ jobs: 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" -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 "${{ 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 }} "${{ env.MODEL_NAME }}/onnx" . --revision "${{ env.SOURCE_MODEL_SIZE }}-onnx" + 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 - name: Cleanup