smtsead commited on
Commit
5ed01cd
·
verified ·
1 Parent(s): 0daac1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -37,10 +37,10 @@ def text2story(text):
37
  str: Generated superhero story suitable for kids aged 3-10, within 100 words.
38
  """
39
  # Load the text generation model
40
- story_generator = pipeline("text-generation", model="pranavpsv/genre-story-generator-v2")
41
 
42
  # Generate the story with the superhero genre
43
- prompt = f"{text}"
44
  story = story_generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
45
 
46
  # Remove <BOS> and <superhero> tags from the generated story
 
37
  str: Generated superhero story suitable for kids aged 3-10, within 100 words.
38
  """
39
  # Load the text generation model
40
+ story_generator = pipeline("text-generation", model="pranavpsv/gpt2-genre-story-generator")
41
 
42
  # Generate the story with the superhero genre
43
+ prompt = f"<BOS> <superhero> {text}"
44
  story = story_generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
45
 
46
  # Remove <BOS> and <superhero> tags from the generated story