Spaces:
Sleeping
Sleeping
Download model.py from dschandra/Text_Summarize: direct link, hf CLI and curl.
- Browser
- Download file 326 Bytes
-
https://huggingface.co/spaces/dschandra/Text_Summarize/resolve/main/model.py
- Command line
-
hf download hf://spaces/dschandra/Text_Summarize/model.py
-
curl -L -o model.py https://huggingface.co/spaces/dschandra/Text_Summarize/resolve/main/model.py
326 Bytes
| from transformers import pipeline | |
| def load_model(): | |
| """ | |
| Load the Hugging Face summarization model using the Hugging Face Transformers library. | |
| """ | |
| # Load the pre-trained summarization pipeline from Hugging Face | |
| summarizer = pipeline("summarization", model="facebook/bart-large-cnn") | |
| return summarizer | |