Skip to content

Commit 6467a74

Browse files
committed
added test for ov examples
1 parent 8c95cae commit 6467a74

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: OpenVINO - Examples Test
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '14 3 * * 1' # run weekly: every Monday at 3:14
7+
push:
8+
paths:
9+
- '.github/workflows/test_openvino_examples.yml'
10+
- 'examples/openvino/*'
11+
pull_request:
12+
paths:
13+
- '.github/workflows/test_openvino_examples.yml'
14+
- 'examples/openvino/*'
15+
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build:
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
python-version: ["3.8", "3.10"]
27+
28+
runs-on: ubuntu-20.04
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Setup Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Install dependencies
38+
run: |
39+
# Install PyTorch CPU to prevent unnecessary downloading/installing of CUDA packages
40+
# ffmpeg, torchaudio and pillow are required for image classification and audio classification pipelines
41+
pip install optimum[openvino] nncf
42+
pip install -r examples/openvino/audio-classification/requirements.txt
43+
pip install -r examples/openvino/image-classification/requirements.txt
44+
pip install -r examples/openvino/question-answering/requirements.txt
45+
pip install -r examples/openvino/text-classification/requirements.txt
46+
47+
- run: free -h
48+
- run: lscpu
49+
- run: pip freeze
50+
51+
- name: Test examples
52+
run: |
53+
python examples/openvino/audio-classification/run_audio_classification.py --model_name_or_path facebook/wav2vec2-base --nncf_compression_config examples/openvino/audio-classification/configs/wav2vec2-base-qat.json --dataset_name superb --dataset_config_name ks --max_train_samples 10 --max_eval_samples 2 --output_dir /tmp/qat-wav2vec2-base-ft-keyword-spotting --overwrite_output_dir --remove_unused_columns False --do_train --learning_rate 3e-5 --max_length_seconds 1 --attention_mask False --warmup_ratio 0.1 --num_train_epochs 1 --gradient_accumulation_steps 1 --dataloader_num_workers 1 --logging_strategy steps --logging_steps 1 --evaluation_strategy epoch --save_strategy epoch --load_best_model_at_end False --seed 42
54+
TASK_NAME=sst2 && python examples/openvino/text-classification/run_glue.py --model_name_or_path sshleifer/tiny-distilbert-base-cased-distilled-squad --task_name $TASK_NAME --max_train_samples 10 --max_eval_samples 2 --output_dir /tmp/qat-bert-base-ft-$TASK_NAME --overwrite_output_dir --do_train --do_eval --max_seq_length 128 --learning_rate 1e-5 --optim adamw_torch --num_train_epochs 1 --logging_steps 1 --evaluation_strategy steps --eval_steps 1 --save_strategy epoch --seed 42
55+
python examples/openvino/question-answering/run_qa.py --model_name_or_path sshleifer/tiny-distilbert-base-cased-distilled-squad --dataset_name squad --do_train --do_eval --max_train_samples 10 --max_eval_samples 2 --learning_rate 3e-5 --num_train_epochs 1 --max_seq_length 384 --doc_stride 128 --output_dir /tmp/outputs_squad/ --overwrite_output_dir
56+
python examples/openvino/image-classification/run_image_classification.py --model_name_or_path nateraw/vit-base-beans --dataset_name beans --max_train_samples 10 --max_eval_samples 2 --remove_unused_columns False --do_train --learning_rate 2e-5 --num_train_epochs 1 --logging_strategy steps --logging_steps 1 --evaluation_strategy epoch --save_strategy epoch --save_total_limit 1 --seed 1337 --output_dir /tmp/beans_outputs/
57+

0 commit comments

Comments
 (0)