Database reference fix and model fetching

multichannel
HeNine 3 years ago
parent f072ca8016
commit 6f90149d41

@ -8,12 +8,8 @@ RUN pip install /tmp/common && rm -r /tmp/common
COPY buscribe /tmp/buscribe COPY buscribe /tmp/buscribe
RUN pip install /tmp/buscribe && rm -r /tmp/buscribe && \ RUN pip install /tmp/buscribe && rm -r /tmp/buscribe && \
mkdir /usr/share/buscribe && cd /usr/share/buscribe && \ mkdir /usr/share/buscribe && cd /usr/share/buscribe
curl -LO http://alphacephei.com/vosk/models/vosk-model-en-us-0.22.zip && \
unzip vosk-model-en-us-0.22.zip && rm vosk-model-en-us-0.22.zip && \ COPY models/extracted /usr/share/buscribe
curl -LO http://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip && \
unzip vosk-model-small-en-us-0.15.zip && rm vosk-model-small-en-us-0.15.zip && \
curl -LO https://alphacephei.com/vosk/models/vosk-model-spk-0.4.zip && \
unzip vosk-model-spk-0.4.zip && rm vosk-model-spk-0.4.zip
ENTRYPOINT ["python3", "-m", "buscribe", "--base-dir", "/mnt"] ENTRYPOINT ["python3", "-m", "buscribe", "--base-dir", "/mnt"]

@ -65,7 +65,7 @@ def transcribe_segments(segments: list, sample_rate: int, recognizer: BuscribeRe
def write_line(line_json: dict, line_start_time: datetime, line_end_time: datetime, db_cursor): def write_line(line_json: dict, line_start_time: datetime, line_end_time: datetime, db_cursor):
"""Commits line to the database""" """Commits line to the database"""
db_cursor.execute( db_cursor.execute(
"INSERT INTO buscribe.public.buscribe_transcriptions(" "INSERT INTO buscribe_transcriptions("
"start_time, " "start_time, "
"end_time, " "end_time, "
"transcription_line, " "transcription_line, "

@ -0,0 +1,11 @@
#!/bin/bash
mkdir models && cd models || exit
curl -LO http://alphacephei.com/vosk/models/vosk-model-en-us-0.22.zip
curl -LO http://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip
curl -LO https://alphacephei.com/vosk/models/vosk-model-spk-0.4.zip
mkdir extracted
unzip vosk-model-en-us-0.22.zip -d extracted
unzip vosk-model-small-en-us-0.15.zip -d extracted
unzip vosk-model-spk-0.4.zip -d extracted
Loading…
Cancel
Save