fyyb commited on
Commit
28db8dd
·
verified ·
1 Parent(s): 6119f50

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -12,12 +12,12 @@ def img2text(url):
12
  # text2story
13
  def text2story(text):
14
  text_generation_model = pipeline("text-generation", model="microsoft/Phi-4-mini-instruct", trust_remote_code=True)
15
- story_text = text_generation_model(text)[0]["generated_text"]
16
  return story_text
17
 
18
  # text2audio
19
  def text2audio(story_text):
20
- text_to_speech_model = pipeline("text-to-speech", model="suno/bark-small")
21
  audio_data = text_to_speech_model(story_text)
22
  return {
23
  'audio': audio_data["audio"],
 
12
  # text2story
13
  def text2story(text):
14
  text_generation_model = pipeline("text-generation", model="microsoft/Phi-4-mini-instruct", trust_remote_code=True)
15
+ story_text = text_generation_model(text, min_length=100, max_length=150)[0]["generated_text"]
16
  return story_text
17
 
18
  # text2audio
19
  def text2audio(story_text):
20
+ text_to_speech_model = pipeline("text-to-speech", model="facebook/mms-tts-eng")
21
  audio_data = text_to_speech_model(story_text)
22
  return {
23
  'audio': audio_data["audio"],