Spaces:
Runtime error
Runtime error
Download app.py from hamadani/deleteMeSpace: direct link, hf CLI and curl.
- Browser
- Download file 576 Bytes
-
https://huggingface.co/spaces/hamadani/deleteMeSpace/resolve/main/app.py
- Command line
-
hf download hf://spaces/hamadani/deleteMeSpace/app.py
-
curl -L -o app.py https://huggingface.co/spaces/hamadani/deleteMeSpace/resolve/main/app.py
576 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # Initialize the Hugging Face summarization pipeline | |
| summarizer = pipeline("summarization", model='t5-base', tokenizer='t5-base') | |
| def summarize_text(input_text): | |
| summary_text = summarizer(input_text, max_length=100, min_length=25, do_sample=False) | |
| return summary_text[0]['summary_text'] | |
| iface = gr.Interface( | |
| fn=summarize_text, | |
| inputs=gr.inputs.Textbox(lines=10, placeholder="Enter Text Here..."), | |
| outputs="text" | |
| ) | |
| if __name__ == "__main__": | |
| iface.launch() |