Spaces:
Build error
Build error
Leo Liu commited on
Update app.py
Browse files9 unmodified lines10111213141516179 unmodified linesreturn text# text2storydef text2story(text):story_text = pipeline("text-generation", model="distilbert/distilgpt2")return story_text# text2audio9 unmodified lines1011121314151617181920212223242526272829309 unmodified linesreturn text# text2storystory_prompt = (f"You are an expert in storytelling for children ages 3-10."f"Based on the image description below:{text}\n"f"Please create a funny, heartwarming, imaginative fairy tale of no less than 50 words"f"Output only the body of the story, do not include other content")def text2story(text):story_text = pipeline("text-generation", model="distilbert/distilgpt2",max_length=200,do_sample=True,top_p=0.95,temperature=0.7)generation = story_text(story_prompt)story_text = generation[0]['generated_text']return story_text# text2audio
app.py+14-1