Spaces:
Sleeping
Sleeping
Download app.py from MonkeyDLLLLLLuffy/TaskOnClass: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/spaces/MonkeyDLLLLLLuffy/TaskOnClass/resolve/main/app.py
- Command line
-
hf download hf://spaces/MonkeyDLLLLLLuffy/TaskOnClass/app.py
-
curl -L -o app.py https://huggingface.co/spaces/MonkeyDLLLLLLuffy/TaskOnClass/resolve/main/app.py
568 Bytes
| import streamlit as st | |
| from transformers import pipeline | |
| # Load pipelines | |
| pipe = pipeline("summarization", model="facebook/bart-large-cnn") | |
| # Application | |
| st.title("Make a summarization!") | |
| user_input = st.text_input("Enter text to summarize:") | |
| if st.button("Summarize Me!"): | |
| if user_input: | |
| with st.spinner('Summarizing...'): | |
| result = pipe(user_input, max_length = 100) | |
| summarization = result[0]['summary_text'] | |
| st.write(f"Summary: {summarization}") | |
| else: | |
| st.warning("Please enter some text to summarize!") |