From 6da4195282f55471ea136cf190821256f89b2a5a Mon Sep 17 00:00:00 2001 From: kunal-vaishnavi <115581922+kunal-vaishnavi@users.noreply.github.com> Date: Fri, 31 Jan 2025 16:16:41 -0800 Subject: [PATCH] Add actual Hugging Face token to CIs (#1214) ### Description This PR replaces the dummy Hugging Face authentication token with an actual read-only token. ### Motivation and Context This fixes the CI failures that are happening. This change is separated from [this PR](https://github.com/microsoft/onnxruntime-genai/pull/1212) for clarity in the repo's commit history. --- .github/workflows/linux-cpu-x64-build.yml | 5 +---- .github/workflows/linux-cpu-x64-nightly-build.yml | 5 +---- .github/workflows/linux-gpu-x64-build.yml | 5 +---- .github/workflows/mac-cpu-arm64-build.yml | 2 +- .github/workflows/win-cpu-x64-build.yml | 5 +---- .github/workflows/win-cuda-x64-build.yml | 5 +---- 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/linux-cpu-x64-build.yml b/.github/workflows/linux-cpu-x64-build.yml index 5fc97369d..9f0daef4e 100644 --- a/.github/workflows/linux-cpu-x64-build.yml +++ b/.github/workflows/linux-cpu-x64-build.yml @@ -10,6 +10,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} ORT_NIGHTLY_REST_API: "https://feeds.dev.azure.com/aiinfra/PublicPackages/_apis/packaging/Feeds/ORT-Nightly/packages?packageNameQuery=Microsoft.ML.OnnxRuntime&api-version=6.0-preview.1" ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime" ORT_NIGHTLY_SOURCE: "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/nuget/v3/index.json" @@ -84,10 +85,6 @@ jobs: python3 -m pip install -r test/python/cpu/ort/requirements.txt --user python3 -m pip install --user --no-index --no-deps --find-links build/cpu/wheel onnxruntime_genai - - name: Use Dummy HuggingFace Token - run: | - echo "HF_TOKEN=12345" >> $GITHUB_ENV - - name: Verify Build Artifacts if: always() continue-on-error: true diff --git a/.github/workflows/linux-cpu-x64-nightly-build.yml b/.github/workflows/linux-cpu-x64-nightly-build.yml index 61be5eb6f..0020c0889 100644 --- a/.github/workflows/linux-cpu-x64-nightly-build.yml +++ b/.github/workflows/linux-cpu-x64-nightly-build.yml @@ -12,6 +12,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} ort_dir: "onnxruntime-linux-x64-1.18.0" ort_zip: "onnxruntime-linux-x64-1.18.0.tgz" ort_url: "https://github.com/microsoft/onnxruntime/releases/download/v1.18.0/onnxruntime-linux-x64-1.18.0.tgz" @@ -55,10 +56,6 @@ jobs: python3 -m pip install -r test/python/cpu/ort/requirements.txt --user python3 -m pip install build/cpu/wheel/onnxruntime_genai*.whl --no-deps - - name: Use Dummy HuggingFace Token - run: | - echo "HF_TOKEN=12345" >> $GITHUB_ENV - - name: Run the python tests run: | python3 test/python/test_onnxruntime_genai.py --cwd test/python --test_models test/test_models --e2e diff --git a/.github/workflows/linux-gpu-x64-build.yml b/.github/workflows/linux-gpu-x64-build.yml index e5a397a73..ccc93b0f8 100644 --- a/.github/workflows/linux-gpu-x64-build.yml +++ b/.github/workflows/linux-gpu-x64-build.yml @@ -12,6 +12,7 @@ concurrency: cancel-in-progress: true env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} ORT_NIGHTLY_REST_API: "https://feeds.dev.azure.com/aiinfra/PublicPackages/_apis/packaging/Feeds/ORT-Nightly/packages?packageNameQuery=Microsoft.ML.OnnxRuntime.Gpu.Linux&api-version=6.0-preview.1" ORT_PACKAGE_NAME: Microsoft.ML.OnnxRuntime.Gpu.Linux ORT_NIGHTLY_SOURCE: "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/nuget/v3/index.json" @@ -109,10 +110,6 @@ jobs: bash -c " \ /usr/bin/cmake --build --preset linux_gcc_cuda_release" - - name: Use Dummy HuggingFace Token - run: | - echo "HF_TOKEN=12345" >> $GITHUB_ENV - - name: Install the onnxruntime-genai Python wheel and run python test run: | echo "Installing the onnxruntime-genai Python wheel and running the Python tests" diff --git a/.github/workflows/mac-cpu-arm64-build.yml b/.github/workflows/mac-cpu-arm64-build.yml index 658f7a660..1adf64a98 100644 --- a/.github/workflows/mac-cpu-arm64-build.yml +++ b/.github/workflows/mac-cpu-arm64-build.yml @@ -10,6 +10,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} ORT_NIGHTLY_REST_API: "https://feeds.dev.azure.com/aiinfra/PublicPackages/_apis/packaging/Feeds/ORT-Nightly/packages?packageNameQuery=Microsoft.ML.OnnxRuntime&api-version=6.0-preview.1" ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime" jobs: @@ -86,7 +87,6 @@ jobs: - name: Run the python tests run: | source genai-macos-venv/bin/activate - export HF_TOKEN="12345" export ORTGENAI_LOG_ORT_LIB=1 python3 -m pip install requests python3 test/python/test_onnxruntime_genai.py --cwd test/python --test_models test/test_models diff --git a/.github/workflows/win-cpu-x64-build.yml b/.github/workflows/win-cpu-x64-build.yml index 3374a3b6d..3264a465e 100644 --- a/.github/workflows/win-cpu-x64-build.yml +++ b/.github/workflows/win-cpu-x64-build.yml @@ -11,6 +11,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} binaryDir: 'build/cpu/win-x64' ORT_NIGHTLY_REST_API: "https://feeds.dev.azure.com/aiinfra/PublicPackages/_apis/packaging/Feeds/ORT-Nightly/packages?packageNameQuery=Microsoft.ML.OnnxRuntime&api-version=6.0-preview.1" ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime" @@ -91,10 +92,6 @@ jobs: python3 -m pip install -r test\python\cpu\ort\requirements.txt --user python3 -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl")) --no-deps - - name: Use Dummy HuggingFace Token - run: | - Add-Content -Path $env:GITHUB_ENV -Value "HF_TOKEN=12345" - - name: Run the Python Tests run: | python test/python/test_onnxruntime_genai.py --cwd "test\python" --test_models "test\test_models" diff --git a/.github/workflows/win-cuda-x64-build.yml b/.github/workflows/win-cuda-x64-build.yml index 5cda163d1..273560b9f 100644 --- a/.github/workflows/win-cuda-x64-build.yml +++ b/.github/workflows/win-cuda-x64-build.yml @@ -12,6 +12,7 @@ concurrency: cancel-in-progress: true env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} AZCOPY_AUTO_LOGIN_TYPE: MSI AZCOPY_MSI_CLIENT_ID: 63b63039-6328-442f-954b-5a64d124e5b4 cuda_dir: "${{ github.workspace }}\\cuda_sdk" @@ -80,10 +81,6 @@ jobs: python -m pip install -r test\python\cuda\ort\requirements.txt python -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl")) --no-deps - - name: Use Dummy HuggingFace Token - run: | - Add-Content -Path $env:GITHUB_ENV -Value "HF_TOKEN=12345" - - name: Run the Python Tests run: | python test/python/test_onnxruntime_genai.py --cwd "test\python" --test_models "test\test_models" --e2e