-
Notifications
You must be signed in to change notification settings - Fork 60
69 lines (63 loc) · 1.95 KB
/
python-examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Python examples (CPU)
on:
push:
branches:
- main
paths:
- "optimum/quanto/**"
- "examples/**"
- "pyproject.toml"
pull_request:
types: [assigned, opened, synchronize, reopened]
paths:
- "optimum/quanto/**"
- "examples/**"
- "pyproject.toml"
jobs:
conventional-commits:
uses: ./.github/workflows/conventional-commits.yml
python-quality:
uses: ./.github/workflows/python-quality.yml
run-examples:
needs: [conventional-commits, python-quality]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Install dependencies
- name: Configure and install dependencies
run: |
pip install --upgrade pip
pip install .[examples]
# Run examples
- name: Run MNIST examples
run: |
for w in int4 int8 float8; do \
for a in none int8 float8; do \
python examples/vision/image-classification/mnist/quantize_mnist_model.py \
--weights $w --activations $a; \
done; \
done
- name: Run OWL detection examples
run: |
for w in int4 int8 float8; do \
python examples/vision/object-detection/quantize_owl_model.py \
--image http://images.cocodataset.org/val2017/000000039769.jpg \
--texts "a photo of a cat" "a remote" \
--weights $w; \
done
- name: Run text-classification examples
run: |
for w in int4 int8; do \
for a in none int8; do \
python examples/nlp/text-classification/sst2/quantize_sst2_model.py \
--weights $w --activations $a; \
done; \
done