Instructions to use cglez/gpt2-dapt-trec with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cglez/gpt2-dapt-trec with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cglez/gpt2-dapt-trec")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cglez/gpt2-dapt-trec") model = AutoModelForCausalLM.from_pretrained("cglez/gpt2-dapt-trec") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use cglez/gpt2-dapt-trec with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cglez/gpt2-dapt-trec" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cglez/gpt2-dapt-trec", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cglez/gpt2-dapt-trec
- SGLang
How to use cglez/gpt2-dapt-trec 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 "cglez/gpt2-dapt-trec" \ --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": "cglez/gpt2-dapt-trec", "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 "cglez/gpt2-dapt-trec" \ --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": "cglez/gpt2-dapt-trec", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cglez/gpt2-dapt-trec with Docker Model Runner:
docker model run hf.co/cglez/gpt2-dapt-trec
Model Card: GPT-2-DAPT-TREC
A domain-adapted GPT-2, further pre-trained on the TREC dataset text.
Model Details
Description
This model is based on the GPT-2 architecture and was further pre-trained (domain-adapted) using the text in TREC dataset, excluding its test split.
- Developed by: Cesar Gonzalez-Gutierrez
- Funded by: ERC
- Architecture: GPT-2
- Language: English
- License: MIT
- Base model: GPT-2
Checkpoints
Intermediate checkpoints from the pre-training process are available and can be accessed using specific tags, which correspond to training epochs and steps:
| Epoch | Step | Tags | |
|---|---|---|---|
| 1 | 51 | epoch-1 | step-51 |
| 5 | 255 | epoch-5 | step-255 |
| 10 | 511 | epoch-10 | step-511 |
| 20 | 1023 | epoch-20 | step-1023 |
| 40 | 2046 | epoch-40 | step-2046 |
| 60 | 3070 | epoch-60 | step-3070 |
| 80 | 4093 | epoch-80 | step-4093 |
| 100 | 5116 | epoch-100 | step-5116 |
| 120 | 6140 | epoch-120 | step-6140 |
| 140 | 7163 | epoch-140 | step-7163 |
| 160 | 8186 | epoch-160 | step-8186 |
| 180 | 9210 | epoch-180 | step-9210 |
| 199 | 10200 | epoch-199 | step-10200 |
To load a model from a specific intermediate checkpoint, use the revision parameter with the corresponding tag:
from transformers import AutoModelForCausalLM
model = AutoModelForMaskedLM.from_pretrained("<model-name>", revision="<checkpoint-tag>")
Sources
- Paper: [Information pending]
Training Details
For more details on the training procedure, please refer to the base model's documentation: Training procedure.
Training Data
All texts from TREC dataset, excluding the test partition.
Training Hyperparameters
- Precision: fp16
- Batch size: 8
- Gradient accumulation steps: 12
Uses
For typical use cases and limitations, please refer to the base model's guidance: Inteded uses & limitations.
Bias, Risks, and Limitations
This model inherits potential risks and limitations from the base model. Refer to: Limitations and bias.
Environmental Impact
- Hardware Type: NVIDIA A100 PCIE 40GB
- Runtime: 7 h
- Cluster Provider: Artemisa
- Compute Region: EU
- Carbon Emitted: 1.08 kg CO2 eq.
Citation
BibTeX:
[More Information Needed]
- Downloads last month
- 3
Model tree for cglez/gpt2-dapt-trec
Base model
openai-community/gpt2