Delete benchmark_hf_pipeline.py
Browse files- benchmark_hf_pipeline.py +0 -27
benchmark_hf_pipeline.py
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
from pprint import pprint
|
2 |
-
from transformers import pipeline
|
3 |
-
from datasets import load_dataset
|
4 |
-
|
5 |
-
# config
|
6 |
-
model_id = "kotoba-tech/kotoba-whisper-v1.0"
|
7 |
-
generate_kwargs = {"language": "japanese", "task": "transcribe"}
|
8 |
-
|
9 |
-
# load model
|
10 |
-
pipe = pipeline(
|
11 |
-
"automatic-speech-recognition",
|
12 |
-
model=model_id,
|
13 |
-
chunk_length_s=15,
|
14 |
-
batch_size=64
|
15 |
-
)
|
16 |
-
test_audio = [
|
17 |
-
"kotoba-whisper-eval/audio/long_interview_1.wav",
|
18 |
-
"kotoba-whisper-eval/audio/manzai1.wav",
|
19 |
-
"kotoba-whisper-eval/audio/manzai2.wav",
|
20 |
-
"kotoba-whisper-eval/audio/manzai3.wav"
|
21 |
-
]
|
22 |
-
elapsed = {}
|
23 |
-
for x in test_audio:
|
24 |
-
start = time()
|
25 |
-
transcription = pipe(x, generate_kwargs=generate_kwargs)
|
26 |
-
elapsed[x] = time() - start
|
27 |
-
pprint(elapsed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|