Remove testing paths
Browse files- LEVI_whisper_benchmark.py +11 -19
LEVI_whisper_benchmark.py
CHANGED
@@ -4,33 +4,24 @@ from benchmark_utils import ASRmanifest, wer_from_csv
|
|
4 |
|
5 |
|
6 |
#%% setup paths
|
7 |
-
corpora_root = '
|
8 |
-
manif_root = '
|
9 |
output_dir = './ASR_output/' # where to save ASR output
|
10 |
-
manifest='
|
11 |
-
model_name= 'LEVI_whisper_medium.en' # name of
|
12 |
hf_org = 'levicu'
|
13 |
model_path = f'{hf_org}/{model_name}'
|
14 |
|
15 |
-
#%%
|
16 |
-
corpora_root = '/shared/corpora/' # root path where audio files are, inserted in palce of $DATAROOT in manifest
|
17 |
-
manif_root = '/shared/corpora/data_manifests/ASR/' # path to dir containing data manifest csvs
|
18 |
-
output_dir = '/home/rosy/whisat-output/' # where to save ASR output
|
19 |
-
manifest= 'LEVI_LoFi_v2_TEST_punc+cased' # name of test manifest
|
20 |
-
model_name= 'LEVI_LoFi_v2_MediumEN_Lora_Int8' # name of save directory of model you want to evaluate
|
21 |
-
model_path='/shared/models/LEVI_LoFi_v2_MediumEN_Lora_Int8/final/'
|
22 |
-
model_path='openai/whisper_medium.en'
|
23 |
-
#%%
|
24 |
-
# generate paths
|
25 |
manifest_csv=os.path.join(manif_root, f'{manifest}.csv')
|
26 |
out_csv=os.path.join(output_dir,f'{model_name}_on_{manifest}.csv')
|
27 |
|
28 |
#%% Inference
|
29 |
ASRmanifest(
|
30 |
-
manifest_csv=manifest_csv,
|
31 |
-
out_csv=out_csv,
|
32 |
-
corpora_root=corpora_root,
|
33 |
-
model_path=model_path,
|
34 |
)
|
35 |
|
36 |
#%% Evaluation
|
@@ -41,7 +32,8 @@ wer_meas=wer_from_csv(
|
|
41 |
refcol='transcript',
|
42 |
hypcol='asr',
|
43 |
printout=True,
|
44 |
-
text_norm_method='levi'
|
45 |
)
|
46 |
|
47 |
|
|
|
|
4 |
|
5 |
|
6 |
#%% setup paths
|
7 |
+
corpora_root = '~/corpora/forSAGA/' # root path where audio files are, inserted in palce of $DATAROOT in manifest
|
8 |
+
manif_root = '~/corpora/forSAGA/data_manifests/' # path to dir containing data manifest csvs
|
9 |
output_dir = './ASR_output/' # where to save ASR output
|
10 |
+
manifest='LEVI_LoFi_v2_TEST_punc+cased' # name of test manifest
|
11 |
+
model_name= 'LEVI_whisper_medium.en' # name of model you want to evaluate
|
12 |
hf_org = 'levicu'
|
13 |
model_path = f'{hf_org}/{model_name}'
|
14 |
|
15 |
+
#%% generate paths
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
manifest_csv=os.path.join(manif_root, f'{manifest}.csv')
|
17 |
out_csv=os.path.join(output_dir,f'{model_name}_on_{manifest}.csv')
|
18 |
|
19 |
#%% Inference
|
20 |
ASRmanifest(
|
21 |
+
manifest_csv=manifest_csv,
|
22 |
+
out_csv=out_csv,
|
23 |
+
corpora_root=corpora_root,
|
24 |
+
model_path=model_path,
|
25 |
)
|
26 |
|
27 |
#%% Evaluation
|
|
|
32 |
refcol='transcript',
|
33 |
hypcol='asr',
|
34 |
printout=True,
|
35 |
+
text_norm_method='levi' # 'whisper','levi','none'
|
36 |
)
|
37 |
|
38 |
|
39 |
+
|