Spaces:
Runtime error
Runtime error
Download app.py from DarshanMM/OpenAICodexSummarizer: direct link, hf CLI and curl.
- Browser
- Download file 433 Bytes
-
https://huggingface.co/spaces/DarshanMM/OpenAICodexSummarizer/resolve/main/app.py
- Command line
-
hf download hf://spaces/DarshanMM/OpenAICodexSummarizer/app.py
-
curl -L -o app.py https://huggingface.co/spaces/DarshanMM/OpenAICodexSummarizer/resolve/main/app.py
433 Bytes
| #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, min_length=30)[0]['summary_text'] | |
| gr.Interface(fn=summarize, inputs=gr.inputs.Textbox(lines=7, placeholder="Enter text here"), outputs="text").launch(inline = False) |