asahi417 commited on
Commit
ebc3d1f
1 Parent(s): 09904a8

Update benchmark.py

Browse files
Files changed (1) hide show
  1. benchmark.py +20 -0
benchmark.py CHANGED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pprint import pprint
2
+ from time import time
3
+ from faster_whisper import WhisperModel
4
+
5
+ model = WhisperModel("kotoba-tech/kotoba-whisper-v1.0-faster")
6
+ test_audio = [
7
+ "kotoba-whisper-eval/audio/long_interview_1.wav",
8
+ "kotoba-whisper-eval/audio/manzai1.wav",
9
+ "kotoba-whisper-eval/audio/manzai2.wav",
10
+ "kotoba-whisper-eval/audio/manzai3.wav"
11
+ ]
12
+ result = {}
13
+ for test_audio_file in test_audio:
14
+ start = time()
15
+ segments, info = model.transcribe(test_audio_file, language="ja", chunk_length=15, condition_on_previous_text=False)
16
+ for segment in segments:
17
+ print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
18
+ elapsed = time() - start
19
+ result[test_audio_file] = elapsed
20
+ pprint(result)