Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use Smaraa/gpt2-text-simplification_1e4_adafactor_newsela with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Smaraa/gpt2-text-simplification_1e4_adafactor_newsela with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Smaraa/gpt2-text-simplification_1e4_adafactor_newsela")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Smaraa/gpt2-text-simplification_1e4_adafactor_newsela") model = AutoModelForCausalLM.from_pretrained("Smaraa/gpt2-text-simplification_1e4_adafactor_newsela") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Smaraa/gpt2-text-simplification_1e4_adafactor_newsela with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Smaraa/gpt2-text-simplification_1e4_adafactor_newsela" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Smaraa/gpt2-text-simplification_1e4_adafactor_newsela", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Smaraa/gpt2-text-simplification_1e4_adafactor_newsela
- SGLang
How to use Smaraa/gpt2-text-simplification_1e4_adafactor_newsela 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 "Smaraa/gpt2-text-simplification_1e4_adafactor_newsela" \ --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": "Smaraa/gpt2-text-simplification_1e4_adafactor_newsela", "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 "Smaraa/gpt2-text-simplification_1e4_adafactor_newsela" \ --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": "Smaraa/gpt2-text-simplification_1e4_adafactor_newsela", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Smaraa/gpt2-text-simplification_1e4_adafactor_newsela with Docker Model Runner:
docker model run hf.co/Smaraa/gpt2-text-simplification_1e4_adafactor_newsela
gpt2-text-simplification_1e4_adafactor_newsela
This model is a fine-tuned version of gpt2 on an unknown dataset. It achieves the following results on the evaluation set:
- Loss: 1.3465
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.0001
- 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: linear
- num_epochs: 20
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.7662 | 1.0 | 1605 | 0.8757 |
| 0.6538 | 2.0 | 3210 | 0.9019 |
| 0.5663 | 3.0 | 4815 | 0.9554 |
| 0.4961 | 4.0 | 6420 | 0.9990 |
| 0.4299 | 5.0 | 8025 | 1.0271 |
| 0.3853 | 6.0 | 9630 | 1.0547 |
| 0.3482 | 7.0 | 11235 | 1.1090 |
| 0.3152 | 8.0 | 12840 | 1.1387 |
| 0.2903 | 9.0 | 14445 | 1.1853 |
| 0.2655 | 10.0 | 16050 | 1.2088 |
| 0.2477 | 11.0 | 17655 | 1.2168 |
| 0.232 | 12.0 | 19260 | 1.2426 |
| 0.2192 | 13.0 | 20865 | 1.2522 |
| 0.2078 | 14.0 | 22470 | 1.2855 |
| 0.198 | 15.0 | 24075 | 1.3048 |
| 0.19 | 16.0 | 25680 | 1.3117 |
| 0.1834 | 17.0 | 27285 | 1.3262 |
| 0.1777 | 18.0 | 28890 | 1.3360 |
| 0.1733 | 19.0 | 30495 | 1.3440 |
| 0.1702 | 20.0 | 32100 | 1.3465 |
Framework versions
- Transformers 4.30.2
- Pytorch 2.0.1+cu118
- Datasets 2.13.1
- Tokenizers 0.13.3
- Downloads last month
- 665