xujinheng666 commited on
Commit
42f31fd
·
verified ·
1 Parent(s): 636df8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,8 +8,8 @@ import os
8
  def load_models():
9
  return {
10
  "image_to_text": pipeline("image-to-text", model="Salesforce/blip-image-captioning-base"),
11
- "story_gen": pipeline("text-generation", model="distilbert/distilgpt2"),
12
- "text_to_speech": pipeline("text-to-speech", model="facebook/mms-tts-yor")
13
  }
14
 
15
  # function part
@@ -18,7 +18,7 @@ def img2text(url, processor):
18
  return text
19
 
20
  def text2story(text, generator, max_length=150):
21
- prompt = f"Create a children's story based on: {text}"
22
  story = generator(
23
  prompt,
24
  max_length=max_length,
 
8
  def load_models():
9
  return {
10
  "image_to_text": pipeline("image-to-text", model="Salesforce/blip-image-captioning-base"),
11
+ "story_gen": pipeline("text-generation", model="Qwen/Qwen2.5-1.5B-Instruct"),
12
+ "text_to_speech": pipeline("text-to-speech", model="facebook/mms-tts-eng")
13
  }
14
 
15
  # function part
 
18
  return text
19
 
20
  def text2story(text, generator, max_length=150):
21
+ prompt = f"Create a story based on: {text}"
22
  story = generator(
23
  prompt,
24
  max_length=max_length,