Database reference fix and model fetching

pull/414/head
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
RUN pip install /tmp/buscribe && rm -r /tmp/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 && \
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
mkdir /usr/share/buscribe && cd /usr/share/buscribe
COPY models/extracted /usr/share/buscribe
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):
"""Commits line to the database"""
db_cursor.execute(
"INSERT INTO buscribe.public.buscribe_transcriptions("
"INSERT INTO buscribe_transcriptions("
"start_time, "
"end_time, "
"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