Spaces:
Build error
Build error
Leo Liu commited on
Update app.py
Browse files17 unmodified lines1819202122232417 unmodified linesdef text2story(text):pipe = pipeline("text-generation", model="pranavpsv/genre-story-generator-v2", max_new_tokens=160, min_new_tokens=130, num_return_sequences=1)story_text = pipe(text)[0]['generated_text']last_punctuation = max(story_text.rfind("."), story_text.rfind("!"), story_text.rfind("?"))if last_punctuation != -1:story_text = story_text[:last_punctuation+1]return story_text17 unmodified lines1819202122232417 unmodified linesdef text2story(text):pipe = pipeline("text-generation", model="pranavpsv/genre-story-generator-v2", max_new_tokens=160, min_new_tokens=130, num_return_sequences=1)story_text = pipe(text)[0]['generated_text']last_punctuation = max(story_text.rfind("."), story_text.rfind("!"), story_text.rfind("?"))if last_punctuation != -1:story_text = story_text[:last_punctuation+1]return story_text
app.py+1-1