Instructions to use RichardErkhov/KipperDev_-_bart_summarizer_model-8bits with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RichardErkhov/KipperDev_-_bart_summarizer_model-8bits with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RichardErkhov/KipperDev_-_bart_summarizer_model-8bits")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RichardErkhov/KipperDev_-_bart_summarizer_model-8bits") model = AutoModelForCausalLM.from_pretrained("RichardErkhov/KipperDev_-_bart_summarizer_model-8bits", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RichardErkhov/KipperDev_-_bart_summarizer_model-8bits with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RichardErkhov/KipperDev_-_bart_summarizer_model-8bits" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RichardErkhov/KipperDev_-_bart_summarizer_model-8bits", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/RichardErkhov/KipperDev_-_bart_summarizer_model-8bits
- SGLang
How to use RichardErkhov/KipperDev_-_bart_summarizer_model-8bits with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "RichardErkhov/KipperDev_-_bart_summarizer_model-8bits" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RichardErkhov/KipperDev_-_bart_summarizer_model-8bits", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "RichardErkhov/KipperDev_-_bart_summarizer_model-8bits" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RichardErkhov/KipperDev_-_bart_summarizer_model-8bits", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use RichardErkhov/KipperDev_-_bart_summarizer_model-8bits with Docker Model Runner:
docker model run hf.co/RichardErkhov/KipperDev_-_bart_summarizer_model-8bits
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Quantization made by Richard Erkhov.
bart_summarizer_model - bnb 8bits
- Model creator: https://huggingface.co/KipperDev/
- Original model: https://huggingface.co/KipperDev/bart_summarizer_model/
Original model description:
license: mit datasets: - big_patent language: - en metrics: - rouge tags: - summarization - summarizer - text summarization - abstractive summarization pipeline_tag: summarization
Table of Contents
Model Details
This variant of the facebook/bart-base model, is fine-tuned specifically for the task of text summarization. This model aims to generate concise, coherent, and informative summaries from extensive text documents, leveraging the power of the BART bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder approach.
Usage
This model is intended for use in summarizing long-form texts into concise, informative abstracts. It's particularly useful for professionals and researchers who need to quickly grasp the essence of detailed reports, research papers, or articles without reading the entire text.
Get Started
Install with pip:
pip install transformers
Use in python:
from transformers import pipeline
from transformers import AutoTokenizer
from transformers import AutoModelForSeq2SeqLM
model_name = "KipperDev/bart_summarizer_model"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
# Example usage
prefix = "summarize: "
input_text = "Your input text here."
input_ids = tokenizer.encode(prefix + input_text, return_tensors="pt")
summary_ids = model.generate(input_ids)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print(summary)
NOTE THAT FOR THE MODEL TO WORK AS INTENDED, YOU NEED TO APPEND THE 'summarize:' PREFIX BEFORE THE INPUT DATA
Training Details
Training Data
The model was trained using the Big Patent Dataset, comprising 1.3 million US patent documents and their corresponding human-written summaries. This dataset was chosen for its rich language and complex structure, representative of the challenging nature of document summarization tasks.
Training involved multiple subsets of the dataset to ensure broad coverage and robust model performance across varied document types.
Training Procedure
Training was conducted over three rounds, with initial settings including a learning rate of 0.00002, batch size of 8, and 4 epochs. Subsequent rounds adjusted these parameters to refine model performance further, for respectively 0.0003, 8 and 12. As well, a linear decay learning rate schedule was applied to enhance model learning efficiency over time.
Training results
Model performance was evaluated using the ROUGE metric, highlighting its capability to generate summaries closely aligned with human-written abstracts.
| Metric | Value |
|---|---|
| Evaluation Loss (Eval Loss) | 1.9244 |
| Rouge-1 | 0.5007 |
| Rouge-2 | 0.2704 |
| Rouge-L | 0.3627 |
| Rouge-Lsum | 0.3636 |
| Average Generation Length (Gen Len) | 122.1489 |
| Runtime (seconds) | 1459.3826 |
| Samples per Second | 1.312 |
| Steps per Second | 0.164 |
Citation
BibTeX:
@article{kipper_t5_summarizer,
// SOON
}
Authors
This model card was written by Fernanda Kipper
- Downloads last month
- 4