Instructions to use NasimB/gpt2-cl-rarity-sampling-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NasimB/gpt2-cl-rarity-sampling-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NasimB/gpt2-cl-rarity-sampling-2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NasimB/gpt2-cl-rarity-sampling-2") model = AutoModelForCausalLM.from_pretrained("NasimB/gpt2-cl-rarity-sampling-2") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NasimB/gpt2-cl-rarity-sampling-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NasimB/gpt2-cl-rarity-sampling-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NasimB/gpt2-cl-rarity-sampling-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NasimB/gpt2-cl-rarity-sampling-2
- SGLang
How to use NasimB/gpt2-cl-rarity-sampling-2 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 "NasimB/gpt2-cl-rarity-sampling-2" \ --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": "NasimB/gpt2-cl-rarity-sampling-2", "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 "NasimB/gpt2-cl-rarity-sampling-2" \ --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": "NasimB/gpt2-cl-rarity-sampling-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NasimB/gpt2-cl-rarity-sampling-2 with Docker Model Runner:
docker model run hf.co/NasimB/gpt2-cl-rarity-sampling-2
gpt2-cl-rarity-sampling-2
This model is a fine-tuned version of gpt2 on the generator dataset. It achieves the following results on the evaluation set:
- Loss: 4.9389
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0005
- train_batch_size: 64
- eval_batch_size: 64
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 1000
- num_epochs: 1
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 6.6041 | 0.03 | 500 | 5.8549 |
| 5.3693 | 0.06 | 1000 | 5.4485 |
| 5.0219 | 0.09 | 1500 | 5.2251 |
| 4.7966 | 0.12 | 2000 | 5.0984 |
| 4.6401 | 0.15 | 2500 | 5.0015 |
| 4.5172 | 0.18 | 3000 | 4.9422 |
| 4.408 | 0.21 | 3500 | 4.9078 |
| 4.3193 | 0.24 | 4000 | 4.8646 |
| 4.2352 | 0.27 | 4500 | 4.8324 |
| 4.1595 | 0.3 | 5000 | 4.8130 |
| 4.0784 | 0.33 | 5500 | 4.8065 |
| 4.0064 | 0.36 | 6000 | 4.7910 |
| 3.9328 | 0.39 | 6500 | 4.7914 |
| 3.8702 | 0.42 | 7000 | 4.7862 |
| 3.8059 | 0.46 | 7500 | 4.7956 |
| 3.7416 | 0.49 | 8000 | 4.7843 |
| 3.6642 | 0.52 | 8500 | 4.7968 |
| 3.6019 | 0.55 | 9000 | 4.8023 |
| 3.5353 | 0.58 | 9500 | 4.8079 |
| 3.472 | 0.61 | 10000 | 4.8171 |
| 3.411 | 0.64 | 10500 | 4.8254 |
| 3.3546 | 0.67 | 11000 | 4.8337 |
| 3.2946 | 0.7 | 11500 | 4.8411 |
| 3.2501 | 0.73 | 12000 | 4.8498 |
| 3.2002 | 0.76 | 12500 | 4.8623 |
| 3.1578 | 0.79 | 13000 | 4.8665 |
| 3.1254 | 0.82 | 13500 | 4.8757 |
| 3.1003 | 0.85 | 14000 | 4.8774 |
| 3.081 | 0.88 | 14500 | 4.8789 |
| 3.0591 | 0.91 | 15000 | 4.8805 |
| 3.0512 | 0.94 | 15500 | 4.8816 |
| 3.0469 | 0.97 | 16000 | 4.8815 |
Framework versions
- Transformers 4.26.1
- Pytorch 1.11.0+cu113
- Datasets 2.13.0
- Tokenizers 0.13.3
- Downloads last month
- -