Anicet commited on
Commit ·
6a7cb13
1
Parent(s): 7e3c986
update: add moore models for STT and TTS
Browse files- Dockerfile +2 -1
- language/mos_stt.py +4 -0
- requirements.txt +97 -6
Dockerfile
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
FROM python:3.10-slim
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
@@ -8,4 +9,4 @@ COPY . .
|
|
| 8 |
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
+
# FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
|
| 3 |
|
| 4 |
WORKDIR /app
|
| 5 |
|
|
|
|
| 9 |
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
| 12 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
language/mos_stt.py
CHANGED
|
@@ -1,9 +1,13 @@
|
|
| 1 |
import base64, tempfile, os
|
| 2 |
from transformers import pipeline
|
| 3 |
import soundfile as sf
|
|
|
|
| 4 |
|
| 5 |
MODEL_NAME = "facebook/mms-1b-all"
|
| 6 |
pipe = pipeline("automatic-speech-recognition", model=MODEL_NAME, model_kwargs={"target_lang": "mos"})
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
def mooreSTT(audioBase64: str) -> dict:
|
|
|
|
| 1 |
import base64, tempfile, os
|
| 2 |
from transformers import pipeline
|
| 3 |
import soundfile as sf
|
| 4 |
+
# from huggingface_hub import login
|
| 5 |
|
| 6 |
MODEL_NAME = "facebook/mms-1b-all"
|
| 7 |
pipe = pipeline("automatic-speech-recognition", model=MODEL_NAME, model_kwargs={"target_lang": "mos"})
|
| 8 |
+
# login(token=os.environ["HF_TOKEN"])
|
| 9 |
+
# MODEL_NAME = "burkimbia/BIA-WHISPER-LARGE-SACHI_V3"
|
| 10 |
+
# pipe = pipeline("automatic-speech-recognition", model=MODEL_NAME)
|
| 11 |
|
| 12 |
|
| 13 |
def mooreSTT(audioBase64: str) -> dict:
|
requirements.txt
CHANGED
|
@@ -1,65 +1,156 @@
|
|
|
|
|
| 1 |
aiohappyeyeballs==2.6.2
|
| 2 |
aiohttp==3.14.1
|
| 3 |
aiosignal==1.4.0
|
| 4 |
annotated-doc==0.0.4
|
| 5 |
annotated-types==0.7.0
|
|
|
|
| 6 |
anyio==4.13.0
|
| 7 |
async-timeout==5.0.1
|
| 8 |
attrs==26.1.0
|
|
|
|
| 9 |
av==17.1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
certifi==2026.5.20
|
| 11 |
cffi==2.0.0
|
|
|
|
| 12 |
click==8.4.1
|
|
|
|
| 13 |
coloredlogs==15.0.1
|
|
|
|
|
|
|
|
|
|
| 14 |
ctranslate2==4.8.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
edge-tts==7.2.8
|
|
|
|
|
|
|
| 16 |
exceptiongroup==1.3.1
|
| 17 |
fastapi==0.136.3
|
| 18 |
faster-whisper==1.2.1
|
| 19 |
filelock==3.29.1
|
|
|
|
| 20 |
flatbuffers==25.12.19
|
|
|
|
| 21 |
frozenlist==1.8.0
|
| 22 |
fsspec==2026.4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
h11==0.16.0
|
| 24 |
-
|
|
|
|
| 25 |
httpcore==1.0.9
|
| 26 |
httpx==0.28.1
|
| 27 |
-
huggingface_hub==1.
|
| 28 |
humanfriendly==10.0
|
| 29 |
idna==3.18
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
Jinja2==3.1.6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
markdown-it-py==4.2.0
|
| 32 |
MarkupSafe==3.0.3
|
|
|
|
| 33 |
mdurl==0.1.2
|
|
|
|
| 34 |
mpmath==1.3.0
|
|
|
|
| 35 |
multidict==6.7.1
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
onnxruntime==1.23.2
|
| 39 |
packaging==26.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
propcache==0.5.2
|
| 41 |
protobuf==7.35.0
|
|
|
|
| 42 |
pycparser==3.0
|
| 43 |
pydantic==2.13.4
|
| 44 |
pydantic_core==2.46.4
|
| 45 |
Pygments==2.20.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
PyYAML==6.0.3
|
| 47 |
regex==2026.5.9
|
|
|
|
| 48 |
rich==15.0.0
|
| 49 |
safetensors==0.7.0
|
| 50 |
-
|
|
|
|
| 51 |
sentencepiece==0.2.1
|
| 52 |
shellingham==1.5.4
|
|
|
|
|
|
|
| 53 |
soundfile==0.14.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
starlette==1.2.1
|
|
|
|
|
|
|
| 55 |
sympy==1.14.0
|
| 56 |
tabulate==0.10.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
tokenizers==0.22.2
|
| 58 |
torch==2.12.0
|
|
|
|
| 59 |
tqdm==4.68.1
|
| 60 |
-
|
|
|
|
|
|
|
| 61 |
typer==0.25.1
|
| 62 |
typing-inspection==0.4.2
|
| 63 |
typing_extensions==4.15.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
uvicorn==0.49.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
yarl==1.24.2
|
|
|
|
| 1 |
+
absl-py==2.4.0
|
| 2 |
aiohappyeyeballs==2.6.2
|
| 3 |
aiohttp==3.14.1
|
| 4 |
aiosignal==1.4.0
|
| 5 |
annotated-doc==0.0.4
|
| 6 |
annotated-types==0.7.0
|
| 7 |
+
anyascii==0.3.3
|
| 8 |
anyio==4.13.0
|
| 9 |
async-timeout==5.0.1
|
| 10 |
attrs==26.1.0
|
| 11 |
+
audioread==3.1.0
|
| 12 |
av==17.1.0
|
| 13 |
+
babel==2.18.0
|
| 14 |
+
bangla==0.0.6
|
| 15 |
+
blinker==1.9.0
|
| 16 |
+
blis==1.3.3
|
| 17 |
+
bnnumerizer==0.0.2
|
| 18 |
+
bnunicodenormalizer==0.1.7
|
| 19 |
+
catalogue==2.0.10
|
| 20 |
certifi==2026.5.20
|
| 21 |
cffi==2.0.0
|
| 22 |
+
charset-normalizer==3.4.7
|
| 23 |
click==8.4.1
|
| 24 |
+
cloudpathlib==0.24.0
|
| 25 |
coloredlogs==15.0.1
|
| 26 |
+
confection==1.3.3
|
| 27 |
+
contourpy==1.2.1
|
| 28 |
+
coqpit==0.0.17
|
| 29 |
ctranslate2==4.8.0
|
| 30 |
+
cycler==0.12.1
|
| 31 |
+
cymem==2.0.13
|
| 32 |
+
Cython==3.2.5
|
| 33 |
+
dateparser==1.1.8
|
| 34 |
+
decorator==5.3.1
|
| 35 |
+
docopt==0.6.2
|
| 36 |
edge-tts==7.2.8
|
| 37 |
+
einops==0.8.2
|
| 38 |
+
encodec==0.1.1
|
| 39 |
exceptiongroup==1.3.1
|
| 40 |
fastapi==0.136.3
|
| 41 |
faster-whisper==1.2.1
|
| 42 |
filelock==3.29.1
|
| 43 |
+
Flask==3.1.3
|
| 44 |
flatbuffers==25.12.19
|
| 45 |
+
fonttools==4.63.0
|
| 46 |
frozenlist==1.8.0
|
| 47 |
fsspec==2026.4.0
|
| 48 |
+
g2pkk==0.1.2
|
| 49 |
+
grpcio==1.81.1
|
| 50 |
+
gruut==2.2.3
|
| 51 |
+
gruut-ipa==0.13.0
|
| 52 |
+
gruut_lang_de==2.0.1
|
| 53 |
+
gruut_lang_en==2.0.1
|
| 54 |
+
gruut_lang_es==2.0.1
|
| 55 |
+
gruut_lang_fr==2.0.2
|
| 56 |
h11==0.16.0
|
| 57 |
+
hangul-romanize==0.1.0
|
| 58 |
+
hf-xet==1.5.1
|
| 59 |
httpcore==1.0.9
|
| 60 |
httpx==0.28.1
|
| 61 |
+
huggingface_hub==1.19.0
|
| 62 |
humanfriendly==10.0
|
| 63 |
idna==3.18
|
| 64 |
+
inflect==7.5.0
|
| 65 |
+
itsdangerous==2.2.0
|
| 66 |
+
jamo==0.4.1
|
| 67 |
+
jieba==0.42.1
|
| 68 |
Jinja2==3.1.6
|
| 69 |
+
joblib==1.5.3
|
| 70 |
+
jsonlines==1.2.0
|
| 71 |
+
kiwisolver==1.5.0
|
| 72 |
+
lazy-loader==0.5
|
| 73 |
+
librosa==0.10.0
|
| 74 |
+
llvmlite==0.47.0
|
| 75 |
+
Markdown==3.10.2
|
| 76 |
markdown-it-py==4.2.0
|
| 77 |
MarkupSafe==3.0.3
|
| 78 |
+
matplotlib==3.8.4
|
| 79 |
mdurl==0.1.2
|
| 80 |
+
more-itertools==11.1.0
|
| 81 |
mpmath==1.3.0
|
| 82 |
+
msgpack==1.2.0
|
| 83 |
multidict==6.7.1
|
| 84 |
+
murmurhash==1.0.15
|
| 85 |
+
networkx==2.8.8
|
| 86 |
+
nltk==3.9.4
|
| 87 |
+
num2words==0.5.14
|
| 88 |
+
numba==0.65.1
|
| 89 |
+
numpy==1.22.0
|
| 90 |
onnxruntime==1.23.2
|
| 91 |
packaging==26.2
|
| 92 |
+
pandas==1.5.3
|
| 93 |
+
pillow==12.2.0
|
| 94 |
+
platformdirs==4.10.0
|
| 95 |
+
pooch==1.9.0
|
| 96 |
+
preshed==3.0.13
|
| 97 |
propcache==0.5.2
|
| 98 |
protobuf==7.35.0
|
| 99 |
+
psutil==7.2.2
|
| 100 |
pycparser==3.0
|
| 101 |
pydantic==2.13.4
|
| 102 |
pydantic_core==2.46.4
|
| 103 |
Pygments==2.20.0
|
| 104 |
+
pynndescent==0.6.0
|
| 105 |
+
pyparsing==3.3.2
|
| 106 |
+
pypinyin==0.55.0
|
| 107 |
+
pysbd==0.3.4
|
| 108 |
+
python-crfsuite==0.9.12
|
| 109 |
+
python-dateutil==2.9.0.post0
|
| 110 |
+
pytz==2026.2
|
| 111 |
PyYAML==6.0.3
|
| 112 |
regex==2026.5.9
|
| 113 |
+
requests==2.34.2
|
| 114 |
rich==15.0.0
|
| 115 |
safetensors==0.7.0
|
| 116 |
+
scikit-learn==1.7.2
|
| 117 |
+
scipy==1.11.4
|
| 118 |
sentencepiece==0.2.1
|
| 119 |
shellingham==1.5.4
|
| 120 |
+
six==1.17.0
|
| 121 |
+
smart_open==7.6.1
|
| 122 |
soundfile==0.14.0
|
| 123 |
+
soxr==1.1.0
|
| 124 |
+
spacy==3.8.14
|
| 125 |
+
spacy-legacy==3.0.12
|
| 126 |
+
spacy-loggers==1.0.5
|
| 127 |
+
srsly==2.5.3
|
| 128 |
starlette==1.2.1
|
| 129 |
+
SudachiDict-core==20260428
|
| 130 |
+
SudachiPy==0.6.11
|
| 131 |
sympy==1.14.0
|
| 132 |
tabulate==0.10.0
|
| 133 |
+
tensorboard==2.20.0
|
| 134 |
+
tensorboard-data-server==0.7.2
|
| 135 |
+
thinc==8.3.13
|
| 136 |
+
threadpoolctl==3.6.0
|
| 137 |
tokenizers==0.22.2
|
| 138 |
torch==2.12.0
|
| 139 |
+
torchaudio==2.11.0
|
| 140 |
tqdm==4.68.1
|
| 141 |
+
trainer==0.0.36
|
| 142 |
+
transformers==5.12.1
|
| 143 |
+
typeguard==4.5.2
|
| 144 |
typer==0.25.1
|
| 145 |
typing-inspection==0.4.2
|
| 146 |
typing_extensions==4.15.0
|
| 147 |
+
tzlocal==5.4
|
| 148 |
+
umap-learn==0.5.7
|
| 149 |
+
Unidecode==1.4.0
|
| 150 |
+
urllib3==2.7.0
|
| 151 |
uvicorn==0.49.0
|
| 152 |
+
wasabi==1.1.3
|
| 153 |
+
weasel==1.0.0
|
| 154 |
+
Werkzeug==3.1.8
|
| 155 |
+
wrapt==2.2.1
|
| 156 |
yarl==1.24.2
|