wh1223 commited on
Commit
8bd42ec
·
verified ·
1 Parent(s): 540ace6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -10,18 +10,17 @@ def img2text(url):
10
 
11
  # text2story
12
  def text2story(text):
13
- messages = f"""Generate a story of about 100 words using the following sentences: {text}."""
14
  # messages = [
15
  # {"role": "system", "content": "You're a chatbot that writes stories based on keywords.The story must contain:Beginning, middle, end,Character development"},
16
  # {"role": "user", "content": "Keywords:"+text},
17
  #]
18
- text_to_story_model= pipeline("text-generation", model="Alexis-Az/Story-Generation-Model")
19
  story_text = text_to_story_model(
20
- messages,
21
  max_length=150,
22
  min_length=50,
23
- do_sample=True,
24
- #early_stopping=False
25
  )[0]['generated_text']
26
  return story_text
27
 
 
10
 
11
  # text2story
12
  def text2story(text):
13
+ #messages = f"""Generate a story of about 100 words using the following sentences: {text}."""
14
  # messages = [
15
  # {"role": "system", "content": "You're a chatbot that writes stories based on keywords.The story must contain:Beginning, middle, end,Character development"},
16
  # {"role": "user", "content": "Keywords:"+text},
17
  #]
18
+ text_to_story_model= pipeline("text-generation", model="Tincando/fiction_story_generator")
19
  story_text = text_to_story_model(
20
+ text,
21
  max_length=150,
22
  min_length=50,
23
+ #do_sample=True,
 
24
  )[0]['generated_text']
25
  return story_text
26