Update benchmark.py
Browse files- benchmark.py +6 -3
benchmark.py
CHANGED
|
@@ -4,16 +4,19 @@ from transformers import pipeline
|
|
| 4 |
from datasets import load_dataset
|
| 5 |
|
| 6 |
# config
|
| 7 |
-
model_id = "kotoba-tech/kotoba-whisper-v1.0"
|
| 8 |
generate_kwargs = {"language": "japanese", "task": "transcribe"}
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# load model
|
| 11 |
pipe = pipeline(
|
| 12 |
"automatic-speech-recognition",
|
| 13 |
model=model_id,
|
| 14 |
-
|
| 15 |
-
|
| 16 |
)
|
|
|
|
| 17 |
test_audio = [
|
| 18 |
"kotoba-whisper-eval/audio/long_interview_1.wav",
|
| 19 |
"kotoba-whisper-eval/audio/manzai1.wav",
|
|
|
|
| 4 |
from datasets import load_dataset
|
| 5 |
|
| 6 |
# config
|
|
|
|
| 7 |
generate_kwargs = {"language": "japanese", "task": "transcribe"}
|
| 8 |
+
model_id = "kotoba-tech/kotoba-whisper-v1.0"
|
| 9 |
+
torch_dtype = torch.float32
|
| 10 |
+
device = "cpu"
|
| 11 |
|
| 12 |
# load model
|
| 13 |
pipe = pipeline(
|
| 14 |
"automatic-speech-recognition",
|
| 15 |
model=model_id,
|
| 16 |
+
torch_dtype=torch_dtype,
|
| 17 |
+
device=device,
|
| 18 |
)
|
| 19 |
+
|
| 20 |
test_audio = [
|
| 21 |
"kotoba-whisper-eval/audio/long_interview_1.wav",
|
| 22 |
"kotoba-whisper-eval/audio/manzai1.wav",
|