Spaces:
Runtime error
Runtime error
Update
Browse files
.gitignore
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
gradio_cached_examples/
|
2 |
-
models
|
3 |
|
4 |
# Byte-compiled / optimized / DLL files
|
5 |
__pycache__/
|
|
|
1 |
gradio_cached_examples/
|
|
|
2 |
|
3 |
# Byte-compiled / optimized / DLL files
|
4 |
__pycache__/
|
Dockerfile
CHANGED
@@ -45,9 +45,8 @@ RUN pyenv install ${PYTHON_VERSION} && \
|
|
45 |
|
46 |
COPY --chown=1000 . ${HOME}/app
|
47 |
RUN pip install -r ${HOME}/app/requirements.txt && \
|
48 |
-
pip install
|
49 |
-
pip install ${HOME}/app/
|
50 |
-
pip install ${HOME}/app/wheels/seamless_communication-1.0.0-py3-none-any.whl
|
51 |
|
52 |
ENV PYTHONPATH=${HOME}/app \
|
53 |
PYTHONUNBUFFERED=1 \
|
|
|
45 |
|
46 |
COPY --chown=1000 . ${HOME}/app
|
47 |
RUN pip install -r ${HOME}/app/requirements.txt && \
|
48 |
+
pip install fairseq2 --pre --extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/nightly/pt2.1.0/cu121 && \
|
49 |
+
pip install ${HOME}/app/whl/seamless_communication-1.0.0-py3-none-any.whl
|
|
|
50 |
|
51 |
ENV PYTHONPATH=${HOME}/app \
|
52 |
PYTHONUNBUFFERED=1 \
|
app.py
CHANGED
@@ -7,6 +7,7 @@ import gradio as gr
|
|
7 |
import numpy as np
|
8 |
import torch
|
9 |
import torchaudio
|
|
|
10 |
from huggingface_hub import snapshot_download
|
11 |
from seamless_communication.inference import Translator
|
12 |
|
@@ -20,8 +21,23 @@ from lang_list import (
|
|
20 |
TEXT_SOURCE_LANGUAGE_NAMES,
|
21 |
)
|
22 |
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
DESCRIPTION = """\
|
27 |
# SeamlessM4T
|
|
|
7 |
import numpy as np
|
8 |
import torch
|
9 |
import torchaudio
|
10 |
+
from fairseq2.assets import InProcAssetMetadataProvider, asset_store
|
11 |
from huggingface_hub import snapshot_download
|
12 |
from seamless_communication.inference import Translator
|
13 |
|
|
|
21 |
TEXT_SOURCE_LANGUAGE_NAMES,
|
22 |
)
|
23 |
|
24 |
+
CHECKPOINTS_PATH = pathlib.Path(os.getenv("CHECKPOINTS_PATH", "/home/user/app/models"))
|
25 |
+
if not CHECKPOINTS_PATH.exists():
|
26 |
+
snapshot_download(repo_id="meta-private/M4Tv2", repo_type="model", local_dir=CHECKPOINTS_PATH)
|
27 |
+
asset_store.env_resolvers.clear()
|
28 |
+
asset_store.env_resolvers.append(lambda: "demo")
|
29 |
+
demo_metadata = [
|
30 |
+
{
|
31 |
+
"name": "seamlessM4T_v2_large@demo",
|
32 |
+
"checkpoint": f"file://{CHECKPOINTS_PATH}/seamlessM4T_v2_large.pt",
|
33 |
+
"char_tokenizer": f"file://{CHECKPOINTS_PATH}/spm_char_lang38_tc.model",
|
34 |
+
},
|
35 |
+
{
|
36 |
+
"name": "vocoder_v2@demo",
|
37 |
+
"checkpoint": f"file://{CHECKPOINTS_PATH}/vocoder_v2.pt",
|
38 |
+
},
|
39 |
+
]
|
40 |
+
asset_store.metadata_providers.append(InProcAssetMetadataProvider(demo_metadata))
|
41 |
|
42 |
DESCRIPTION = """\
|
43 |
# SeamlessM4T
|
wheels/fairseq2-0.2.0.dev0-py3-none-any.whl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:0ef5a6eef679333aeb08d24bee6a054120bd7d29d67a60c4a73ca4aaa5bcc261
|
3 |
-
size 187508
|
|
|
|
|
|
|
|
wheels/fairseq2n-0.2.0.dev0-cp310-cp310-linux_x86_64.whl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4865d75ce2a48aaf7b7416c7b109dec123fdc577186b9cabe2d83b74cb27d3fa
|
3 |
-
size 2213239
|
|
|
|
|
|
|
|
{wheels → whl}/seamless_communication-1.0.0-py3-none-any.whl
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c3380dc7d6613c4dc9ef4d78fd3dcf1a50f7c6a659b8ba0b37ad5237533d002e
|
3 |
+
size 234811
|