Skip to content

Commit

Permalink
added offline test
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Apr 23, 2024
1 parent 365c91f commit 0c8a784
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test_offline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Offline usage / Python - Test

on:
push:
branches:
- main
- hub-offline*
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: [3.9]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for pytorch export
run: |
pip install .[tests,openvino]
- name: Test with unittest
run: |
HF_HOME=/tmp/ huggingface-cli download hf-internal-testing/tiny-random-gpt2
HF_HOME=/tmp/ HF_HUB_OFFLINE=1 optimum-cli export openvino --model hf-internal-testing/tiny-random-gpt2 gpt2_openvino --task text-generation
huggingface-cli download hf-internal-testing/tiny-random-gpt2
HF_HUB_OFFLINE=1 optimum-cli export openvino --model hf-internal-testing/tiny-random-gpt2 gpt2_openvino --task text-generation
pytest tests/openvino/test_modeling.py -k "test_load_model_from_hub and not from_hub_openvino" -s -vvvvv
HF_HUB_OFFLINE=1 pytest tests/openvinoruntime/test_modeling.py -k "test_load_model_from_hub and not from_hub_openvino" -s -vvvvv

0 comments on commit 0c8a784

Please sign in to comment.