Text Generation
Transformers
TensorBoard
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Instructions to use Loess/gpt2-wikitext2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Loess/gpt2-wikitext2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Loess/gpt2-wikitext2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Loess/gpt2-wikitext2") model = AutoModelForCausalLM.from_pretrained("Loess/gpt2-wikitext2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Loess/gpt2-wikitext2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Loess/gpt2-wikitext2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Loess/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Loess/gpt2-wikitext2
- SGLang
How to use Loess/gpt2-wikitext2 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 "Loess/gpt2-wikitext2" \ --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": "Loess/gpt2-wikitext2", "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 "Loess/gpt2-wikitext2" \ --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": "Loess/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Loess/gpt2-wikitext2 with Docker Model Runner:
docker model run hf.co/Loess/gpt2-wikitext2
End of training
Browse files
README.md
CHANGED
|
@@ -12,6 +12,8 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 12 |
# gpt2-wikitext2
|
| 13 |
|
| 14 |
This model was trained from scratch on the None dataset.
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## Model description
|
| 17 |
|
|
@@ -38,6 +40,15 @@ The following hyperparameters were used during training:
|
|
| 38 |
- lr_scheduler_type: linear
|
| 39 |
- num_epochs: 3.0
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
### Framework versions
|
| 42 |
|
| 43 |
- Transformers 4.35.2
|
|
|
|
| 12 |
# gpt2-wikitext2
|
| 13 |
|
| 14 |
This model was trained from scratch on the None dataset.
|
| 15 |
+
It achieves the following results on the evaluation set:
|
| 16 |
+
- Loss: 6.1108
|
| 17 |
|
| 18 |
## Model description
|
| 19 |
|
|
|
|
| 40 |
- lr_scheduler_type: linear
|
| 41 |
- num_epochs: 3.0
|
| 42 |
|
| 43 |
+
### Training results
|
| 44 |
+
|
| 45 |
+
| Training Loss | Epoch | Step | Validation Loss |
|
| 46 |
+
|:-------------:|:-----:|:----:|:---------------:|
|
| 47 |
+
| 6.5506 | 1.0 | 2249 | 6.4767 |
|
| 48 |
+
| 6.1913 | 2.0 | 4498 | 6.1990 |
|
| 49 |
+
| 6.0109 | 3.0 | 6747 | 6.1108 |
|
| 50 |
+
|
| 51 |
+
|
| 52 |
### Framework versions
|
| 53 |
|
| 54 |
- Transformers 4.35.2
|
runs/Jan25_18-51-34_17fc482beebe/events.out.tfevents.1706208695.17fc482beebe.463.0
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e00933976720a79973530f7c3a569b4ed19d2623d630f6b9029c471e9f952132
|
| 3 |
+
size 7710
|
runs/Jan25_18-51-34_17fc482beebe/events.out.tfevents.1706211286.17fc482beebe.463.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6595240d2c6f8e889cc7526c007a42299147ec8ed89ec8386bf8d48900bf4d5
|
| 3 |
+
size 359
|