Instructions to use Zekunli/gpt2-large-NaturalQuestions_1000-ep20 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Zekunli/gpt2-large-NaturalQuestions_1000-ep20 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Zekunli/gpt2-large-NaturalQuestions_1000-ep20")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Zekunli/gpt2-large-NaturalQuestions_1000-ep20") model = AutoModelForCausalLM.from_pretrained("Zekunli/gpt2-large-NaturalQuestions_1000-ep20", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Zekunli/gpt2-large-NaturalQuestions_1000-ep20 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Zekunli/gpt2-large-NaturalQuestions_1000-ep20" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zekunli/gpt2-large-NaturalQuestions_1000-ep20", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Zekunli/gpt2-large-NaturalQuestions_1000-ep20
- SGLang
How to use Zekunli/gpt2-large-NaturalQuestions_1000-ep20 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 "Zekunli/gpt2-large-NaturalQuestions_1000-ep20" \ --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": "Zekunli/gpt2-large-NaturalQuestions_1000-ep20", "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 "Zekunli/gpt2-large-NaturalQuestions_1000-ep20" \ --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": "Zekunli/gpt2-large-NaturalQuestions_1000-ep20", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Zekunli/gpt2-large-NaturalQuestions_1000-ep20 with Docker Model Runner:
docker model run hf.co/Zekunli/gpt2-large-NaturalQuestions_1000-ep20
gpt2-large-NaturalQuestions_1000-ep20
This model is a fine-tuned version of gpt2-large on the None dataset. It achieves the following results on the evaluation set:
- Loss: 1.6582
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: 2e-05
- train_batch_size: 12
- eval_batch_size: 24
- seed: 1799
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 20
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.2555 | 0.6 | 50 | 1.0453 |
| 0.9434 | 1.19 | 100 | 1.0152 |
| 0.5866 | 1.79 | 150 | 1.0386 |
| 0.3851 | 2.38 | 200 | 1.1380 |
| 0.2864 | 2.98 | 250 | 1.1513 |
| 0.1613 | 3.57 | 300 | 1.2101 |
| 0.1386 | 4.17 | 350 | 1.2794 |
| 0.0886 | 4.76 | 400 | 1.2708 |
| 0.0716 | 5.36 | 450 | 1.3450 |
| 0.0611 | 5.95 | 500 | 1.3262 |
| 0.0353 | 6.55 | 550 | 1.4632 |
| 0.0361 | 7.14 | 600 | 1.4107 |
| 0.0275 | 7.74 | 650 | 1.4471 |
| 0.026 | 8.33 | 700 | 1.4811 |
| 0.0177 | 8.93 | 750 | 1.4831 |
| 0.015 | 9.52 | 800 | 1.4696 |
| 0.0146 | 10.12 | 850 | 1.5135 |
| 0.0126 | 10.71 | 900 | 1.5145 |
| 0.0118 | 11.31 | 950 | 1.5373 |
| 0.0117 | 11.9 | 1000 | 1.5292 |
| 0.0141 | 12.5 | 1050 | 1.5793 |
| 0.0074 | 13.1 | 1100 | 1.5453 |
| 0.0122 | 13.69 | 1150 | 1.5645 |
| 0.0092 | 14.29 | 1200 | 1.5721 |
| 0.0045 | 14.88 | 1250 | 1.5957 |
| 0.0054 | 15.48 | 1300 | 1.6253 |
| 0.0048 | 16.07 | 1350 | 1.6197 |
| 0.0035 | 16.67 | 1400 | 1.6325 |
| 0.0054 | 17.26 | 1450 | 1.6444 |
| 0.0041 | 17.86 | 1500 | 1.6465 |
| 0.0034 | 18.45 | 1550 | 1.6622 |
| 0.0036 | 19.05 | 1600 | 1.6589 |
| 0.0035 | 19.64 | 1650 | 1.6578 |
Framework versions
- Transformers 4.29.2
- Pytorch 1.10.0+cu111
- Datasets 2.5.1
- Tokenizers 0.13.3
- Downloads last month
- 14