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
|
@@ -13,7 +13,12 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 13 |
|
| 14 |
This model was trained from scratch on the None dataset.
|
| 15 |
It achieves the following results on the evaluation set:
|
| 16 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
## Model description
|
| 19 |
|
|
@@ -38,16 +43,7 @@ The following hyperparameters were used during training:
|
|
| 38 |
- seed: 42
|
| 39 |
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 40 |
- lr_scheduler_type: linear
|
| 41 |
-
- num_epochs:
|
| 42 |
-
|
| 43 |
-
### Training results
|
| 44 |
-
|
| 45 |
-
| Training Loss | Epoch | Step | Validation Loss |
|
| 46 |
-
|:-------------:|:-----:|:----:|:---------------:|
|
| 47 |
-
| 6.5488 | 1.0 | 2249 | 6.4740 |
|
| 48 |
-
| 6.1896 | 2.0 | 4498 | 6.1968 |
|
| 49 |
-
| 6.0128 | 3.0 | 6747 | 6.1090 |
|
| 50 |
-
|
| 51 |
|
| 52 |
### Framework versions
|
| 53 |
|
|
|
|
| 13 |
|
| 14 |
This model was trained from scratch on the None dataset.
|
| 15 |
It achieves the following results on the evaluation set:
|
| 16 |
+
- eval_loss: 5.4415
|
| 17 |
+
- eval_runtime: 21.4584
|
| 18 |
+
- eval_samples_per_second: 90.128
|
| 19 |
+
- eval_steps_per_second: 11.278
|
| 20 |
+
- epoch: 8.23
|
| 21 |
+
- step: 18500
|
| 22 |
|
| 23 |
## Model description
|
| 24 |
|
|
|
|
| 43 |
- seed: 42
|
| 44 |
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 45 |
- lr_scheduler_type: linear
|
| 46 |
+
- num_epochs: 10
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
### Framework versions
|
| 49 |
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 497774208
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:600d7abb21a9a0e2fb4937929556846c787d38b20017001c3151f8f1c32d206f
|
| 3 |
size 497774208
|
runs/Jan29_23-46-38_50257248f344/events.out.tfevents.1706571999.50257248f344.419.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:6550886df3148db1ab1a936e2aeea37ef7ec4ca665dea0a6e218fe381269643c
|
| 3 |
+
size 12774
|