Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -39,19 +39,11 @@ def Image_Caption(image):
|
|
39 |
|
40 |
# Function to generate a story
|
41 |
def Generate_story(textAbout):
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
# Extract the generated text
|
49 |
-
story = story[0]['generated_text']
|
50 |
-
|
51 |
-
# Clean up the story
|
52 |
-
story = story.replace('\n', ' ').replace('arafed', ' ')
|
53 |
-
|
54 |
-
return story
|
55 |
|
56 |
# Function to generate audio
|
57 |
def Generate_audio(text, voice='bm_lewis', speed=1):
|
|
|
39 |
|
40 |
# Function to generate a story
|
41 |
def Generate_story(textAbout):
|
42 |
+
storyAbout = {"role": "user", "content": f'write a long story about {textAbout} that takes 3 min to read'},
|
43 |
+
story = generator(storyAbout)
|
44 |
+
story = story[0]['generated_text']
|
45 |
+
story = story.replace('\n', ' ').replace('arafed', ' ')
|
46 |
+
return story
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
# Function to generate audio
|
49 |
def Generate_audio(text, voice='bm_lewis', speed=1):
|