Spaces:
Build error
Build error
| import gradio as gr | |
| from transformers import pipeline | |
| pipe = pipeline("summarization", model="facebook/bart-large-cnn") | |
| def summarize(text): | |
| word_count = len(text.split()) | |
| if word_count < 70: | |
| return ("Input a minimum of 70 words.") | |
| elif word_count >= 70: | |
| return pipe(text) | |
| demo = gr.Interface(fn = summarize, inputs="text", outputs="text" ) | |
| demo.launch() |