forked from openai/whisper
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Translation works only for plain text for now. It's useless if you would like to translate YouTube video to upload subtitles for English for example. This modified code will make sure translation output is also formatted to SRT.
Start on line 137, predict.py:
if translate:
translationResult = model.transcribe(
str(audio), task="translate", temperature=temperature, **args
)
# MODIFIED to translate to SRT
translation = write_srt(translationResult["segments"])
return ModelOutput(
segments=result["segments"],
detected_language=LANGUAGES[result["language"]],
transcription=transcription,
translation=translation if translate else None,
)
I tested it on another model, works great.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels