Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,9 @@ def img2text(url):
|
|
10 |
|
11 |
# text2story
|
12 |
def text2story(text):
|
13 |
-
|
|
|
|
|
14 |
return story_text
|
15 |
|
16 |
# text2audio
|
@@ -41,14 +43,14 @@ if uploaded_file is not None:
|
|
41 |
story = text2story(scenario)
|
42 |
st.write(story)
|
43 |
|
44 |
-
#Stage 3: Story to Audio data
|
45 |
-
st.text('Generating audio data...')
|
46 |
-
audio_data =text2audio(story)
|
47 |
-
|
48 |
-
# Play button
|
49 |
-
if st.button("Play Audio"):
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
10 |
|
11 |
# text2story
|
12 |
def text2story(text):
|
13 |
+
text_to_story = pipeline("text-generation", model="isarth/distill_gpt2_story_generator")
|
14 |
+
# story_text = "" # to be completed
|
15 |
+
story_text = text_to_story(text)[0]["generated_text"]
|
16 |
return story_text
|
17 |
|
18 |
# text2audio
|
|
|
43 |
story = text2story(scenario)
|
44 |
st.write(story)
|
45 |
|
46 |
+
# #Stage 3: Story to Audio data
|
47 |
+
# st.text('Generating audio data...')
|
48 |
+
# audio_data =text2audio(story)
|
49 |
+
|
50 |
+
# # Play button
|
51 |
+
# if st.button("Play Audio"):
|
52 |
+
# st.audio(audio_data['audio'],
|
53 |
+
# format="audio/wav",
|
54 |
+
# start_time=0,
|
55 |
+
# sample_rate = audio_data['sampling_rate'])
|
56 |
+
# # st.audio("kids_playing_audio.wav")
|