Spaces:
Runtime error
Runtime error
Download app.py from Jayanthi/NLPShowCase: direct link, hf CLI and curl.
- Browser
- Download file 467 Bytes
-
https://huggingface.co/spaces/Jayanthi/NLPShowCase/resolve/main/app.py
- Command line
-
hf download hf://spaces/Jayanthi/NLPShowCase/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Jayanthi/NLPShowCase/resolve/main/app.py
467 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| #Summarize | |
| def greet(name): | |
| return "Hello "+name + " abc" | |
| #get_completion = pipeline('summarization',model='sshleifer/distilbart-cnn-12-6') | |
| get_completion = pipeline('summarization',model='google/flan-t5-base') | |
| def summarize(input): | |
| output = get_completion(input) | |
| return "Summary : " + output[0]['summary_text'] | |
| iface = gr.Interface(fn=summarize, inputs = "text",outputs='text') | |
| iface.launch() | |