use large-v3-turbo
This commit is contained in:
parent
ecf5effc83
commit
2fa33c0902
3 changed files with 4 additions and 3 deletions
|
@ -11,12 +11,13 @@ add "transcribe" to LOCAL_APPS in local_setttings.py
|
||||||
|
|
||||||
## install whisper_timestamped
|
## install whisper_timestamped
|
||||||
|
|
||||||
|
apt install portaudio19-dev
|
||||||
python3 -m venv venv /opt/whisper-timestamped/
|
python3 -m venv venv /opt/whisper-timestamped/
|
||||||
/opt/whisper-timestamped/bin/pip install \
|
/opt/whisper-timestamped/bin/pip install \
|
||||||
torch==1.13.1+cpu \
|
torch==1.13.1+cpu \
|
||||||
torchaudio==0.13.1+cpu \
|
torchaudio==0.13.1+cpu \
|
||||||
-f https://download.pytorch.org/whl/torch_stable.html
|
-f https://download.pytorch.org/whl/torch_stable.html
|
||||||
/opt/whisper-timestamped/bin/pip install whisper-timestamped
|
/opt/whisper-timestamped/bin/pip install whisper-timestamped transformers auditok
|
||||||
|
|
||||||
## configuration
|
## configuration
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import whisper_timestamped as whisper
|
||||||
|
|
||||||
|
|
||||||
def transcribe(path, language=None, translate=None):
|
def transcribe(path, language=None, translate=None):
|
||||||
model = whisper.load_model("turbo")
|
model = whisper.load_model("large-v3-turbo")
|
||||||
audio = whisper.load_audio(path)
|
audio = whisper.load_audio(path)
|
||||||
if translate:
|
if translate:
|
||||||
task = "translate"
|
task = "translate"
|
||||||
|
|
|
@ -118,7 +118,7 @@ def extract_subtitles(item, user, layer, translate, gpu=False, join_sentences=Fa
|
||||||
cmd += [src, output]
|
cmd += [src, output]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.check_output(cmd)
|
subprocess.check_call(cmd)
|
||||||
except:
|
except:
|
||||||
logger.error(
|
logger.error(
|
||||||
"failed to extract subtitles from item %s\n%s", item.public_id, cmd
|
"failed to extract subtitles from item %s\n%s", item.public_id, cmd
|
||||||
|
|
Loading…
Add table
Reference in a new issue