MoJaff commited on
Commit
53372eb
·
verified ·
1 Parent(s): fbb7d6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -13
app.py CHANGED
@@ -39,19 +39,11 @@ def Image_Caption(image):
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
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):