Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ import re
|
|
16 |
import transformers
|
17 |
import scipy
|
18 |
from transformers import pipeline
|
19 |
-
from bark import SAMPLE_RATE, generate_audio, preload_models
|
20 |
#from scipy.io.wavfile import write as write_wav
|
21 |
#from IPython.display import Audio
|
22 |
import gradio as gr
|
@@ -69,15 +69,15 @@ def abstract_to_audio(insert_pdf):
|
|
69 |
|
70 |
# Generate audio file that speaks the generated sentence using Bark
|
71 |
# download and load all models
|
72 |
-
preload_models()
|
73 |
|
74 |
# generate audio from text
|
75 |
-
audio_array = generate_audio(tss_prompt)
|
76 |
-
return (SAMPLE_RATE, audio_array)
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
|
82 |
|
83 |
|
|
|
16 |
import transformers
|
17 |
import scipy
|
18 |
from transformers import pipeline
|
19 |
+
#from bark import SAMPLE_RATE, generate_audio, preload_models
|
20 |
#from scipy.io.wavfile import write as write_wav
|
21 |
#from IPython.display import Audio
|
22 |
import gradio as gr
|
|
|
69 |
|
70 |
# Generate audio file that speaks the generated sentence using Bark
|
71 |
# download and load all models
|
72 |
+
#preload_models()
|
73 |
|
74 |
# generate audio from text
|
75 |
+
#audio_array = generate_audio(tss_prompt)
|
76 |
+
#return (SAMPLE_RATE, audio_array)
|
77 |
|
78 |
+
tss_pipeline = pipeline("text-to-speech", "suno/bark")
|
79 |
+
speech = tss_pipeline(tss_prompt)
|
80 |
+
return (speech["sampling_rate"], speech["audio"])
|
81 |
|
82 |
|
83 |
|