Skip to content

Update to SpeechBrain v1.0 #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker_images/speechbrain/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM tiangolo/uvicorn-gunicorn:python3.8
FROM tiangolo/uvicorn-gunicorn:python3.9
LABEL maintainer="me <[email protected]>"

# Add any system dependency here
# RUN apt-get update -y && apt-get install libXXX -y
RUN apt-get update -y && apt-get install ffmpeg -y

RUN pip install --no-cache-dir torch==1.11
RUN pip install --no-cache-dir torch==2.0
COPY ./requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
COPY ./prestart.sh /app/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import torch
from app.common import ModelType, get_type
from app.pipelines import Pipeline
from speechbrain.pretrained import EncoderClassifier
from speechbrain.inference import EncoderClassifier


class AudioClassificationPipeline(Pipeline):
Expand Down
2 changes: 1 addition & 1 deletion docker_images/speechbrain/app/pipelines/audio_to_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import torch
from app.common import ModelType, get_type
from app.pipelines import Pipeline
from speechbrain.pretrained import (
from speechbrain.inference import (
SepformerSeparation,
SpectralMaskEnhancement,
WaveformEnhancement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import torch
from app.common import ModelType, get_type
from app.pipelines import Pipeline
from speechbrain.pretrained import EncoderASR, EncoderDecoderASR, WhisperASR
from speechbrain.inference import EncoderASR, EncoderDecoderASR, WhisperASR


class AutomaticSpeechRecognitionPipeline(Pipeline):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from app.common import ModelType, get_type
from app.pipelines import Pipeline
from speechbrain.pretrained import GraphemeToPhoneme
from speechbrain.inference import GraphemeToPhoneme


POSTPROCESSING = {ModelType.GRAPHEMETOPHONEME: lambda output: "-".join(output)}
Expand Down
4 changes: 3 additions & 1 deletion docker_images/speechbrain/app/pipelines/text_to_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from app.common import ModelType, get_type, get_vocoder_model_id
from app.pipelines import Pipeline
from speechbrain.pretrained import HIFIGAN, FastSpeech2, Tacotron2
from speechbrain.inference import HIFIGAN, FastSpeech2, Tacotron2


class TextToSpeechPipeline(Pipeline):
Expand Down Expand Up @@ -37,6 +37,8 @@ def __call__(self, inputs: str) -> Tuple[np.array, int]:
Return:
A :obj:`np.array` and a :obj:`int`: The raw waveform as a numpy array, and the sampling rate as an int.
"""
if not inputs.replace("\0", "").strip():
inputs = "Empty query"
if self.type == "tacotron2":
mel_output, _, _ = self.model.encode_text(inputs)
elif self.type == "fastspeech2":
Expand Down
2 changes: 1 addition & 1 deletion docker_images/speechbrain/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ starlette==0.27.0
api-inference-community==0.0.32
huggingface_hub>=0.7
transformers==4.30.0
git+https://github.com/speechbrain/speechbrain@v0.5.15
git+https://github.com/speechbrain/speechbrain@v1.0.0
#Dummy.