ekwek commited on
Commit
bbea18f
·
verified ·
1 Parent(s): 96b0eae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -7,6 +7,7 @@ import tempfile
7
  import os
8
  import spaces
9
 
 
10
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
11
  print(DEVICE)
12
 
@@ -52,7 +53,7 @@ with gr.Blocks() as demo:
52
 
53
  with gr.Row():
54
  with gr.Column():
55
- gr.Markdown("# Soprano Demo")
56
 
57
  text_in = gr.Textbox(
58
  label="Input Text",
@@ -62,7 +63,7 @@ with gr.Blocks() as demo:
62
 
63
  with gr.Accordion("Advanced options", open=False):
64
  temperature = gr.Slider(
65
- 0.0, 1.0, value=0.3, step=0.05, label="Temperature"
66
  )
67
  top_p = gr.Slider(
68
  0.0, 1.0, value=0.95, step=0.01, label="Top-p"
@@ -79,8 +80,8 @@ with gr.Blocks() as demo:
79
  autoplay=True,
80
  streaming=False,
81
  )
82
- download_btn = gr.Button("Download")
83
- file_out = gr.File(label="Download file")
84
  gr.Markdown(
85
  "Usage tips:\n\n"
86
  "- Soprano works best when each sentence is between 2 and 15 seconds long.\n"
@@ -95,11 +96,11 @@ with gr.Blocks() as demo:
95
  outputs=[audio_out, state_audio],
96
  )
97
 
98
- download_btn.click(
99
- fn=save_audio,
100
- inputs=[state_audio],
101
- outputs=[file_out],
102
- )
103
 
104
  demo.queue()
105
  demo.launch()
 
7
  import os
8
  import spaces
9
 
10
+ assert torch.cuda.is_available(), "Demo requires a GPU."
11
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
12
  print(DEVICE)
13
 
 
53
 
54
  with gr.Row():
55
  with gr.Column():
56
+ gr.Markdown("# Soprano Demo\n\nSoprano is an ultra‑lightweight, open‑source text‑to‑speech (TTS) model designed for real‑time, high‑fidelity speech synthesis at unprecedented speed. Soprano can achieve **<15 ms streaming latency** and up to **2000x real-time generation**, all while being easy to deploy at **<1 GB VRAM usage**.")
57
 
58
  text_in = gr.Textbox(
59
  label="Input Text",
 
63
 
64
  with gr.Accordion("Advanced options", open=False):
65
  temperature = gr.Slider(
66
+ 0.0, 1.5, value=0.8, step=0.05, label="Temperature"
67
  )
68
  top_p = gr.Slider(
69
  0.0, 1.0, value=0.95, step=0.01, label="Top-p"
 
80
  autoplay=True,
81
  streaming=False,
82
  )
83
+ #download_btn = gr.Button("Download")
84
+ #file_out = gr.File(label="Download file")
85
  gr.Markdown(
86
  "Usage tips:\n\n"
87
  "- Soprano works best when each sentence is between 2 and 15 seconds long.\n"
 
96
  outputs=[audio_out, state_audio],
97
  )
98
 
99
+ #download_btn.click(
100
+ # fn=save_audio,
101
+ # inputs=[state_audio],
102
+ # outputs=[file_out],
103
+ #)
104
 
105
  demo.queue()
106
  demo.launch()