MoJaff commited on
Commit
3719419
·
verified ·
1 Parent(s): 870ed22

Update app.py

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