Skip to content

Commit 2b2644a

Browse files
Manjunath Kudlurkeveman
authored andcommitted
Add example wav file and command line transcription
1 parent d71901c commit 2b2644a

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

examples/whisper/assets/asknot.wav

319 KB
Binary file not shown.

examples/whisper/transcribe_wav.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
import sys
3+
4+
from .whisper import decode_wav_file
5+
6+
7+
def main():
8+
if len(sys.argv) < 2:
9+
wav_file = os.path.join(os.path.dirname(__file__), 'assets', 'asknot.wav')
10+
else:
11+
wav_file = sys.argv[1]
12+
text = decode_wav_file(wav_file)
13+
print(text)
14+
15+
16+
if __name__ == '__main__':
17+
main()

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
description='Efficient Transformer models inference',
66
author='Useful Sensors Inc.',
77
license='GPLv3',
8-
package_dir={'useful_whisper': 'examples/whisper'},
9-
packages=['useful_whisper'],
8+
package_dir={'useful_transformers': 'examples/whisper'},
9+
packages=['useful_transformers'],
1010
package_data={
11-
'useful_whisper': ['assets/*', 'weights/*'],
11+
'useful_transformers': ['assets/*', 'weights/*'],
1212
},
1313
cmake_install_dir='examples/whisper',
1414
python_requires=">=3.7",

0 commit comments

Comments
 (0)