Instructions to use d0p3/t5-small-dailycnn with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use d0p3/t5-small-dailycnn with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="d0p3/t5-small-dailycnn")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("d0p3/t5-small-dailycnn") model = AutoModelForSeq2SeqLM.from_pretrained("d0p3/t5-small-dailycnn", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use d0p3/t5-small-dailycnn with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "d0p3/t5-small-dailycnn" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "d0p3/t5-small-dailycnn", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/d0p3/t5-small-dailycnn
- SGLang
How to use d0p3/t5-small-dailycnn 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 "d0p3/t5-small-dailycnn" \ --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": "d0p3/t5-small-dailycnn", "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 "d0p3/t5-small-dailycnn" \ --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": "d0p3/t5-small-dailycnn", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use d0p3/t5-small-dailycnn with Docker Model Runner:
docker model run hf.co/d0p3/t5-small-dailycnn
YAML Metadata Warning:The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
My Fine-Tuned T5-Small for Article & News Summarization
Description
This model is a fine-tuned version of the T5-small model for article and news summarization. It has been trained on the CNN/Dailymail dataset to generate concise summaries of news articles.
How to Use
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("d0p3/t5-small-dailycnn")
model = AutoModelForSeq2SeqLM.from_pretrained("d0p3/t5-small-dailycnn")
text = """
(Your long article text to summarize goes here.)
"""
inputs = tokenizer("summarize: " + text, return_tensors="pt", max_length=512, truncation=True)
summary_ids = model.generate(inputs["input_ids"], num_beams=4, max_length=128)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print(summary)
Training Details
- Dataset: CNN/Dailymail (version 3.0.0)
- Base Model: T5-small
- Learning Rate: 2e-5
- Batch Size: 4
- Epochs: 3
- Optimizer: AdamW with Weight Decay (0.01)
- Hardware: 1 x RTX 4090
- Framework: PyTorch
Limitations
- This model may not perform well on article styles significantly different from the CNN/Dailymail dataset.
- As with many language models, it may potentially reproduce biases or inaccuracies present in the training data.
Ethical Considerations
Please use this model responsibly. Consider how the generated summaries may inadvertently perpetuate harmful stereotypes or misinformation.
Contact
Feel free to leave feedback or issues on this Hugging Face repository.
Key Points:
- Clear Structure: Use headings and sections to improve readability.
- Details: Provide specifics about the fine-tuning process.
- Disclaimers: Highlight limitations and encourage responsible use.
Let me know if you'd like any modifications or additions to tailor this README further!
- Downloads last month
- 15