Spaces:
Runtime error
Runtime error
File size: 384 Bytes
6f18e3d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#python3
#build a text summarizer using hugging face and gradio
import gradio as gr
import pandas as pd
import numpy as np
from transformers import pipeline
def summarize(text):
summarizer = pipeline("summarization")
return summarizer(text, max_length=512)[0]['summary_text']
iface = gr.Interface(summarize, "textbox", "label")
if __name__ == "__main__":
iface.launch() |