You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
I tested it on another model, works great.
The text was updated successfully, but these errors were encountered: