-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (68 loc) · 2.53 KB
/
python-arabic.yml
File metadata and controls
81 lines (68 loc) · 2.53 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
name: python
on:
push:
branches: [ main ]
pull_request:
jobs:
infer:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('python/arabic/setup.py') }}-${{ hashFiles('python/arabic/requirements.txt') }}
- name: Install requirements
working-directory: ./python/arabic
run: |
pip install --upgrade --upgrade-strategy eager -r requirements.txt -e .
- name: Download PyTorch model
working-directory: ./python/arabic
run: |
curl -sSL https://github.com/secryst/rababa-models/releases/download/0.1/2000000-snapshot.pt \
-o log_dir/CA_MSA.base.cbhg/models/2000000-snapshot.pt
- name: Run diacriticization
working-directory: ./python/arabic
run: |
python diacritize.py --model_kind "cbhg" --config config/cbhg.yml --text 'قطر'
train:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('python/setup.py') }}-${{ hashFiles('python/requirements.txt') }}
- name: Install requirements
working-directory: ./python/arabic
run: |
pip install --upgrade --upgrade-strategy eager -r requirements.txt -e .
- name: Prepare dataset
working-directory: ./python/arabic
run: |
mkdir -p data/CA_MSA
touch data/CA_MSA/{eval,train,test}.csv
cd data
curl -sSL https://github.com/interscript/rababa-tashkeela/archive/refs/tags/v1.0.zip -o tashkeela.zip
unzip tashkeela.zip
for d in `ls rababa-tashkeela-1.0/tashkeela_val/*`; do cat $d >> CA_MSA/eval.csv; done
for d in `ls rababa-tashkeela-1.0/tashkeela_train/*`; do cat $d >> CA_MSA/train.csv; done
for d in `ls rababa-tashkeela-1.0/tashkeela_test/*`; do cat $d >> CA_MSA/test.csv; done
- name: Try training (WIP)
working-directory: ./python/arabic
run: |
python train.py --model "cbhg" --config config/test_cbhg.yml