-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (93 loc) · 3.01 KB
/
Copy pathpython-hebrew.yml
File metadata and controls
110 lines (93 loc) · 3.01 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Python Hebrew CI
on:
push:
branches: [ main ]
paths:
- 'python/hebrew/**'
- '.github/workflows/python-hebrew.yml'
pull_request:
paths:
- 'python/hebrew/**'
- '.github/workflows/python-hebrew.yml'
# Cancel in-progress runs for the same workflow and branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
security-events: write
jobs:
dependency-review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Dependency Review
uses: actions/dependency-review-action@v3
infer:
runs-on: ubuntu-latest
# cold pip cache: the eager torch wheel is ~5GB
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
python/hebrew/requirements.txt
python/hebrew/setup.py
- name: Install requirements
working-directory: ./python/hebrew
run: |
python -m pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -r requirements.txt -e .
- name: Create model directory
working-directory: ./python/hebrew
run: |
mkdir -p log_dir/base.cbhg/
- name: Run diacriticization
working-directory: ./python/hebrew
run: |
python diacritize.py --model_kind "cbhg" --config config/cbhg.yml --text 'שלום'
train:
runs-on: ubuntu-latest
# the WIP 51-step CPU train needs ~36 min after install
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
python/hebrew/requirements.txt
python/hebrew/setup.py
- name: Install requirements
working-directory: ./python/hebrew
run: |
python -m pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -r requirements.txt -e .
- name: Prepare test data
working-directory: ./python/hebrew
run: |
mkdir -p data/train data/eval
printf "שלום עולם\nשלום עולם\nשלום עולם\nשלום עולם\nשלום עולם\n" > data/train/test.txt
printf "שלום עולם\nשלום עולם\n" > data/eval/test.txt
- name: Try training (WIP)
working-directory: ./python/hebrew
run: |
python train.py --model "cbhg" --config config/test_cbhg.yml