Spaces:
Sleeping
Sleeping
Download model.py from VoltIC/Automated-Text-Summarizer: direct link, hf CLI and curl.
- Browser
- Download file 355 Bytes
-
https://huggingface.co/spaces/VoltIC/Automated-Text-Summarizer/resolve/main/model.py
- Command line
-
hf download hf://spaces/VoltIC/Automated-Text-Summarizer/model.py
-
curl -L -o model.py https://huggingface.co/spaces/VoltIC/Automated-Text-Summarizer/resolve/main/model.py
355 Bytes
| from transformers import pipeline | |
| model_name = "facebook/bart-large-cnn" | |
| summarizer = pipeline("summarization", model=model_name) | |
| # Save the model and tokenizer to a local directory | |
| # This is the Hugging Face standard for 'pickling' a model | |
| summarizer.save_pretrained("./summarizer_model") | |
| print("Model saved successfully to ./summarizer_model") |