Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -39,10 +39,18 @@ def Image_Caption(image):
|
|
39 |
|
40 |
# Function to generate a story
|
41 |
def Generate_story(textAbout):
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
44 |
story = story[0]['generated_text']
|
|
|
|
|
45 |
story = story.replace('\n', ' ').replace('arafed', ' ')
|
|
|
46 |
return story
|
47 |
|
48 |
# Function to generate audio
|
|
|
39 |
|
40 |
# Function to generate a story
|
41 |
def Generate_story(textAbout):
|
42 |
+
# Define the prompt as a string
|
43 |
+
prompt = f'write a long story about {textAbout} that takes 3 min to read'
|
44 |
+
|
45 |
+
# Generate the story using the generator pipeline
|
46 |
+
story = generator(prompt)
|
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
|