added example

This commit is contained in:
Kristofer Söderström
2023-03-22 12:07:29 +01:00
parent 79bfa76b36
commit fb21374d62
8 changed files with 212 additions and 11 deletions

View File

@@ -1,10 +1,9 @@
import whisper
import glob, os
def transcribe(path, file_type, model='base', language=None, verbose=True):
'''Implementation of OpenAI's whisper model. Downloads model, transcribes audio files
in a folder and returns the text files with transcriptions.'''
def transcribe(path, file_type, model=None, language=None, verbose=True):
'''Implementation of OpenAI's whisper model. Downloads model, transcribes audio files in a folder and returns the text files with transcriptions'''
try:
os.mkdir('{}transcriptions'.format(path))
except FileExistsError: