Instructions to use Bainbridge/gpt2-ear_1_migrants-hs_cn with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Bainbridge/gpt2-ear_1_migrants-hs_cn with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Bainbridge/gpt2-ear_1_migrants-hs_cn")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Bainbridge/gpt2-ear_1_migrants-hs_cn") model = AutoModelForCausalLM.from_pretrained("Bainbridge/gpt2-ear_1_migrants-hs_cn") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Bainbridge/gpt2-ear_1_migrants-hs_cn with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Bainbridge/gpt2-ear_1_migrants-hs_cn" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Bainbridge/gpt2-ear_1_migrants-hs_cn", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Bainbridge/gpt2-ear_1_migrants-hs_cn
- SGLang
How to use Bainbridge/gpt2-ear_1_migrants-hs_cn 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 "Bainbridge/gpt2-ear_1_migrants-hs_cn" \ --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": "Bainbridge/gpt2-ear_1_migrants-hs_cn", "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 "Bainbridge/gpt2-ear_1_migrants-hs_cn" \ --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": "Bainbridge/gpt2-ear_1_migrants-hs_cn", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Bainbridge/gpt2-ear_1_migrants-hs_cn with Docker Model Runner:
docker model run hf.co/Bainbridge/gpt2-ear_1_migrants-hs_cn
gpt2-ear_1_migrants-hs_cn
This model is a fine-tuned version of gpt2-medium on an unknown dataset. It achieves the following results on the evaluation set:
- Loss: 0.5331
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: 5e-05
- train_batch_size: 8
- eval_batch_size: 4
- seed: 21
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 3.0
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 69.995 | 0.03 | 10 | 64.5661 |
| 28.3476 | 0.06 | 20 | 18.0685 |
| 5.2324 | 0.08 | 30 | 6.3912 |
| 0.7104 | 0.11 | 40 | 2.7627 |
| -0.8669 | 0.14 | 50 | 1.2027 |
| -1.7912 | 0.17 | 60 | 0.8591 |
| -1.7957 | 0.2 | 70 | 0.7706 |
| -2.1587 | 0.23 | 80 | 0.7197 |
| -2.1961 | 0.25 | 90 | 0.6167 |
| -2.1901 | 0.28 | 100 | 0.6059 |
| -2.0514 | 0.31 | 110 | 0.5845 |
| -2.0839 | 0.34 | 120 | 0.5717 |
| -2.1579 | 0.37 | 130 | 0.5667 |
| -2.0266 | 0.4 | 140 | 0.5601 |
| -2.2698 | 0.42 | 150 | 0.5582 |
| -2.1635 | 0.45 | 160 | 0.5694 |
| -2.1359 | 0.48 | 170 | 0.5584 |
| -2.1628 | 0.51 | 180 | 0.5510 |
| -2.0485 | 0.54 | 190 | 0.5520 |
| -2.1333 | 0.57 | 200 | 0.5431 |
| -2.2908 | 0.59 | 210 | 0.5438 |
| -2.1131 | 0.62 | 220 | 0.5545 |
| -2.1988 | 0.65 | 230 | 0.5371 |
| -2.187 | 0.68 | 240 | 0.5349 |
| -2.0381 | 0.71 | 250 | 0.5504 |
| -2.1413 | 0.74 | 260 | 0.5293 |
| -2.0951 | 0.76 | 270 | 0.5257 |
| -2.2314 | 0.79 | 280 | 0.5263 |
| -2.1851 | 0.82 | 290 | 0.5291 |
| -2.2318 | 0.85 | 300 | 0.5331 |
Framework versions
- Transformers 4.29.0.dev0
- Pytorch 1.12.0a0+bd13bc6
- Datasets 2.12.0
- Tokenizers 0.13.3
- Downloads last month
- 3