-
Notifications
You must be signed in to change notification settings - Fork 111
120 lines (103 loc) · 3.53 KB
/
test-online-websocket-rtf-wer.yaml
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
111
112
113
114
115
116
117
118
119
120
name: Test RTF and WER of C++ online websocket server
on:
push:
branches:
- master
paths:
- '.github/workflows/test-online-websocket-rtf-wer.yaml'
- '.github/scripts/test-online-websocket-rtf-wer.sh'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa/csrc/**'
- 'sherpa/cpp_api/**'
pull_request:
types: [labeled]
paths:
- '.github/workflows/test-online-websocket-rtf-wer.yaml'
- '.github/scripts/test-online-websocket-rtf-wer.sh'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa/csrc/**'
- 'sherpa/cpp_api/**'
workflow_dispatch:
concurrency:
group: test_rtf_and_wer_cpp_online_websocket_server-${{ github.ref }}
cancel-in-progress: true
jobs:
test_rtf_and_wer_cpp_online_websocket_server:
if: github.event.label.name == 'rtf' || github.event_name == 'push'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
torch: ["1.13.1"]
torchaudio: ["0.13.1"]
python-version: ["3.10"]
decoding_method: ["greedy_search", "modified_beam_search"]
num_connections: [50, 100, 200]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Display number of CPU cores
shell: bash
run: |
echo "Number of CPU cores: ${{ steps.cpu-cores.outputs.count }}"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display gcc version
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
gcc --version
- name: Display clang version
if: startsWith(matrix.os, 'macos')
shell: bash
run: |
clang --version
- name: Install apt dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install libsndfile1-dev libsndfile1
- name: Install PyTorch ${{ matrix.torch }}
shell: bash
run: |
python3 -m pip install wheel twine typing_extensions
python3 -m pip install torch==${{ matrix.torch }} torchaudio==${{ matrix.torchaudio }} numpy -f https://download.pytorch.org/whl/cpu/torch_stable.html
python3 -m pip install k2==1.24.4.dev20240223+cpu.torch${{ matrix.torch }} -f https://k2-fsa.github.io/k2/cpu.html
python3 -m torch.utils.collect_env
- name: Cache kaldifeat
id: my-cache-2
uses: actions/cache@v2
with:
path: |
~/tmp/kaldifeat
key: cache-tmp-${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.torch }}
- name: Install kaldifeat
if: steps.my-cache-2.outputs.cache-hit != 'true'
shell: bash
run: |
.github/scripts/install-kaldifeat.sh
- name: Run RTF test
shell: bash
env:
DECODING_METHOD: ${{ matrix.decoding_method }}
NUM_CONNECTIONS: ${{ matrix.num_connections }}
run: |
export KALDIFEAT_INSTALL_PREFIX=$HOME/tmp/kaldifeat/build
echo $KALDIFEAT_INSTALL_PREFIX
ls -lh $KALDIFEAT_INSTALL_PREFIX
.github/scripts/test-online-websocket-rtf-wer.sh
cat ./log.txt
- name: Upload decoding results
uses: actions/upload-artifact@v4
with:
name: os-${{ matrix.os }}-decoding-method-${{ matrix.decoding_method }}
path: ./*.txt