Use Transformers.js 3.0.0
Browse files- index.html +4 -2
index.html
CHANGED
@@ -11,17 +11,19 @@ transformers_js_py
|
|
11 |
</gradio-requirements>
|
12 |
|
13 |
<gradio-file name="app.py" entrypoint>
|
14 |
-
from
|
15 |
import gradio as gr
|
16 |
import numpy as np
|
17 |
|
18 |
-
|
|
|
19 |
|
20 |
synthesizer = await pipeline(
|
21 |
'text-to-speech',
|
22 |
'Xenova/speecht5_tts',
|
23 |
{ "quantized": False }
|
24 |
)
|
|
|
25 |
|
26 |
|
27 |
async def synthesize(text):
|
|
|
11 |
</gradio-requirements>
|
12 |
|
13 |
<gradio-file name="app.py" entrypoint>
|
14 |
+
from transformers_js_py import import_transformers_js
|
15 |
import gradio as gr
|
16 |
import numpy as np
|
17 |
|
18 |
+
transformers_js = await import_transformers_js("3.0.0")
|
19 |
+
pipeline = transformers_js.pipeline
|
20 |
|
21 |
synthesizer = await pipeline(
|
22 |
'text-to-speech',
|
23 |
'Xenova/speecht5_tts',
|
24 |
{ "quantized": False }
|
25 |
)
|
26 |
+
speaker_embeddings = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/speaker_embeddings.bin';
|
27 |
|
28 |
|
29 |
async def synthesize(text):
|