Skip to content

Commit 656ed28

Browse files
TParcolletNarsil
andauthored
Update to SpeechBrain v1.0 (#414)
* initial commit to bump v1 * Bump python version in Dockerfile * increase torch version * *Fixing* the invalid test error. --------- Co-authored-by: Nicolas Patry <[email protected]>
1 parent b0fd3dd commit 656ed28

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

docker_images/speechbrain/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM tiangolo/uvicorn-gunicorn:python3.8
1+
FROM tiangolo/uvicorn-gunicorn:python3.9
22
LABEL maintainer="me <[email protected]>"
33

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

8-
RUN pip install --no-cache-dir torch==1.11
8+
RUN pip install --no-cache-dir torch==2.0
99
COPY ./requirements.txt /app
1010
RUN pip install --no-cache-dir -r requirements.txt
1111
COPY ./prestart.sh /app/

docker_images/speechbrain/app/pipelines/audio_classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import torch
55
from app.common import ModelType, get_type
66
from app.pipelines import Pipeline
7-
from speechbrain.pretrained import EncoderClassifier
7+
from speechbrain.inference import EncoderClassifier
88

99

1010
class AudioClassificationPipeline(Pipeline):

docker_images/speechbrain/app/pipelines/audio_to_audio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import torch
55
from app.common import ModelType, get_type
66
from app.pipelines import Pipeline
7-
from speechbrain.pretrained import (
7+
from speechbrain.inference import (
88
SepformerSeparation,
99
SpectralMaskEnhancement,
1010
WaveformEnhancement,

docker_images/speechbrain/app/pipelines/automatic_speech_recognition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import torch
55
from app.common import ModelType, get_type
66
from app.pipelines import Pipeline
7-
from speechbrain.pretrained import EncoderASR, EncoderDecoderASR, WhisperASR
7+
from speechbrain.inference import EncoderASR, EncoderDecoderASR, WhisperASR
88

99

1010
class AutomaticSpeechRecognitionPipeline(Pipeline):

docker_images/speechbrain/app/pipelines/text2text_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from app.common import ModelType, get_type
44
from app.pipelines import Pipeline
5-
from speechbrain.pretrained import GraphemeToPhoneme
5+
from speechbrain.inference import GraphemeToPhoneme
66

77

88
POSTPROCESSING = {ModelType.GRAPHEMETOPHONEME: lambda output: "-".join(output)}

docker_images/speechbrain/app/pipelines/text_to_speech.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
from app.common import ModelType, get_type, get_vocoder_model_id
55
from app.pipelines import Pipeline
6-
from speechbrain.pretrained import HIFIGAN, FastSpeech2, Tacotron2
6+
from speechbrain.inference import HIFIGAN, FastSpeech2, Tacotron2
77

88

99
class TextToSpeechPipeline(Pipeline):
@@ -37,6 +37,8 @@ def __call__(self, inputs: str) -> Tuple[np.array, int]:
3737
Return:
3838
A :obj:`np.array` and a :obj:`int`: The raw waveform as a numpy array, and the sampling rate as an int.
3939
"""
40+
if not inputs.replace("\0", "").strip():
41+
inputs = "Empty query"
4042
if self.type == "tacotron2":
4143
mel_output, _, _ = self.model.encode_text(inputs)
4244
elif self.type == "fastspeech2":

docker_images/speechbrain/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ starlette==0.27.0
33
api-inference-community==0.0.32
44
huggingface_hub>=0.7
55
transformers==4.30.0
6-
git+https://github.com/speechbrain/speechbrain@v0.5.15
6+
git+https://github.com/speechbrain/speechbrain@v1.0.0
77
#Dummy.

0 commit comments

Comments
 (0)