CR7CAD commited on
Commit
d996989
·
verified ·
1 Parent(s): 6f17888

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -17,6 +17,17 @@ def text2story(text):
17
 
18
  # Create a prompt for the story generation
19
  prompt = f"Write a fun children's story based on this: {text}. Once upon a time, "
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  # Extract the generated text
22
  story_text = story_result[0]['generated_text']
 
17
 
18
  # Create a prompt for the story generation
19
  prompt = f"Write a fun children's story based on this: {text}. Once upon a time, "
20
+
21
+ # Generate the story
22
+ story_result = generator(
23
+ prompt,
24
+ max_length=150,
25
+ num_return_sequences=1,
26
+ temperature=0.7,
27
+ top_k=50,
28
+ top_p=0.95,
29
+ do_sample=True
30
+ )
31
 
32
  # Extract the generated text
33
  story_text = story_result[0]['generated_text']