How to save my output with python? #2570
TheStalke
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Hello, here's the example of using import whisper
from whisper.utils import get_writer
def whisper_transcribe(
audio_path: str,
model_name: str='tiny',
output_format: str='json',
output_dir: str='./',
):
model = whisper.load_model(model_name)
language = "en" if model_name.endswith(".en") else None
result = model.transcribe(
audio_path, language=language, temperature=0.0, word_timestamps=True
)
output = get_writer(output_format=output_format, output_dir=output_dir)
output(result, audio_path=audio_path) It saves the transcripted audio file in JSON in the current directory. However, you can specify other formats: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is literally the python usage example code in README file and I tried to add the get_writer function to save the output but I wasn't able to, can someone tell me what am I doing wrong
Beta Was this translation helpful? Give feedback.
All reactions