Update index.html
Browse files- index.html +31 -17
index.html
CHANGED
@@ -1,19 +1,33 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
|
|
1 |
<html>
|
2 |
+
<head>
|
3 |
+
<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script>
|
4 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" />
|
5 |
+
</head>
|
6 |
+
<body>
|
7 |
+
<gradio-lite>
|
8 |
+
|
9 |
+
<gradio-requirements>
|
10 |
+
transformers_js_py
|
11 |
+
</gradio-requirements>
|
12 |
+
|
13 |
+
<gradio-file name="app.py" entrypoint>
|
14 |
+
from transformers_js import import_transformers_js
|
15 |
+
import gradio as gr
|
16 |
+
|
17 |
+
speaker_embeddings = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/speaker_embeddings.bin';
|
18 |
+
|
19 |
+
transformers = await import_transformers_js()
|
20 |
+
pipeline = transformers.pipeline
|
21 |
+
synthesizer = await pipeline('text-to-speech', 'Xenova/speecht5_tts', { "quantized": False })
|
22 |
+
|
23 |
+
async def classify(text):
|
24 |
+
return await synthesizer(text, { "speaker_embeddings": speaker_embeddings });
|
25 |
+
|
26 |
+
demo = gr.Interface(classify, "textbox", "audio")
|
27 |
+
demo.launch()
|
28 |
+
</gradio-file>
|
29 |
+
|
30 |
+
</gradio-lite>
|
31 |
+
|
32 |
+
</body>
|
33 |
</html>
|