bhagatsuryainatom
commited on
Commit
·
464934c
1
Parent(s):
a9e18e8
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ model = BarkModel.from_pretrained("suno/bark-small")
|
|
11 |
# convert to bettertransformer
|
12 |
model = model.to_bettertransformer()
|
13 |
|
14 |
-
def text_to_audio(question
|
15 |
voice_preset = "v2/en_speaker_6"
|
16 |
inputs = processor(question, voice_preset=voice_preset)
|
17 |
audio_array = model.generate(**inputs)
|
@@ -26,17 +26,14 @@ def text_to_audio(question, question_type):
|
|
26 |
return wav_data
|
27 |
|
28 |
# Define the Gradio interface
|
29 |
-
def gradio_interface(question
|
30 |
-
wav_data = text_to_audio(question
|
31 |
return {"audio": wav_data}
|
32 |
|
33 |
# Define the Gradio UI components
|
34 |
interface = gr.Interface(
|
35 |
fn=gradio_interface,
|
36 |
-
inputs=
|
37 |
-
gr.components.Textbox(label="Question"),
|
38 |
-
gr.components.Dropdown(choices=["Type1", "Type2", "Type3"], label="Question Type")
|
39 |
-
],
|
40 |
outputs=gr.components.Audio(type="numpy"),
|
41 |
live=True
|
42 |
)
|
|
|
11 |
# convert to bettertransformer
|
12 |
model = model.to_bettertransformer()
|
13 |
|
14 |
+
def text_to_audio(question):
|
15 |
voice_preset = "v2/en_speaker_6"
|
16 |
inputs = processor(question, voice_preset=voice_preset)
|
17 |
audio_array = model.generate(**inputs)
|
|
|
26 |
return wav_data
|
27 |
|
28 |
# Define the Gradio interface
|
29 |
+
def gradio_interface(question):
|
30 |
+
wav_data = text_to_audio(question)
|
31 |
return {"audio": wav_data}
|
32 |
|
33 |
# Define the Gradio UI components
|
34 |
interface = gr.Interface(
|
35 |
fn=gradio_interface,
|
36 |
+
inputs=gr.components.Textbox(label="Question"),
|
|
|
|
|
|
|
37 |
outputs=gr.components.Audio(type="numpy"),
|
38 |
live=True
|
39 |
)
|