aliabd HF staff commited on
Commit
e7b9122
1 Parent(s): eef74e2

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. run.ipynb +1 -1
  2. run.py +2 -2
run.ipynb CHANGED
@@ -1 +1 @@
1
- {"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: neon-tts-plugin-coqui\n", "### This demo converts text to speech in 14 languages.\n", " "]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio neon-tts-plugin-coqui==0.4.1a9"]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["# Downloading files from the demo repo\n", "import os\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/neon-tts-plugin-coqui/packages.txt"]}, {"cell_type": "code", "execution_count": null, "id": "44380577570523278879349135829904343037", "metadata": {}, "outputs": [], "source": ["import tempfile\n", "import gradio as gr\n", "from neon_tts_plugin_coqui import CoquiTTS\n", "\n", "LANGUAGES = list(CoquiTTS.langs.keys())\n", "coquiTTS = CoquiTTS()\n", "\n", "def tts(text: str, language: str):\n", " with tempfile.NamedTemporaryFile(suffix=\".wav\", delete=False) as fp:\n", " coquiTTS.get_tts(text, fp, speaker = {\"language\" : language})\n", " return fp.name\n", "\n", "inputs = [gr.Textbox(label=\"Input\", value=CoquiTTS.langs[\"en\"][\"sentence\"], max_lines=3), \n", " gr.Radio(label=\"Language\", choices=LANGUAGES, value=\"en\")]\n", "outputs = gr.Audio(label=\"Output\")\n", "\n", "demo = gr.Interface(fn=tts, inputs=inputs, outputs=outputs)\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
 
1
+ {"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: neon-tts-plugin-coqui\n", "### This demo converts text to speech in 14 languages.\n", " "]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio neon-tts-plugin-coqui==0.4.1a9"]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["# Downloading files from the demo repo\n", "import os\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/neon-tts-plugin-coqui/packages.txt"]}, {"cell_type": "code", "execution_count": null, "id": "44380577570523278879349135829904343037", "metadata": {}, "outputs": [], "source": ["import tempfile\n", "import gradio as gr\n", "from neon_tts_plugin_coqui import CoquiTTS\n", "\n", "LANGUAGES = list(CoquiTTS.langs.keys())\n", "coquiTTS = CoquiTTS()\n", "\n", "def tts(text: str, language: str):\n", " with tempfile.NamedTemporaryFile(suffix=\".wav\", delete=False) as fp:\n", " coquiTTS.get_tts(text, fp, speaker = {\"language\" : language})\n", " return fp.name\n", "\n", "inputs = [gr.Textbox(label=\"Input\", value=CoquiTTS.langs[\"en\"][\"sentence\"], max_lines=3),\n", " gr.Radio(label=\"Language\", choices=LANGUAGES, value=\"en\")]\n", "outputs = gr.Audio(label=\"Output\")\n", "\n", "demo = gr.Interface(fn=tts, inputs=inputs, outputs=outputs)\n", "\n", "demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
run.py CHANGED
@@ -10,10 +10,10 @@ def tts(text: str, language: str):
10
  coquiTTS.get_tts(text, fp, speaker = {"language" : language})
11
  return fp.name
12
 
13
- inputs = [gr.Textbox(label="Input", value=CoquiTTS.langs["en"]["sentence"], max_lines=3),
14
  gr.Radio(label="Language", choices=LANGUAGES, value="en")]
15
  outputs = gr.Audio(label="Output")
16
 
17
  demo = gr.Interface(fn=tts, inputs=inputs, outputs=outputs)
18
 
19
- demo.launch()
 
10
  coquiTTS.get_tts(text, fp, speaker = {"language" : language})
11
  return fp.name
12
 
13
+ inputs = [gr.Textbox(label="Input", value=CoquiTTS.langs["en"]["sentence"], max_lines=3),
14
  gr.Radio(label="Language", choices=LANGUAGES, value="en")]
15
  outputs = gr.Audio(label="Output")
16
 
17
  demo = gr.Interface(fn=tts, inputs=inputs, outputs=outputs)
18
 
19
+ demo.launch()