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,7 @@ 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 |
-
- Loss: 6.
|
| 17 |
|
| 18 |
## Model description
|
| 19 |
|
|
@@ -44,9 +44,9 @@ The following hyperparameters were used during training:
|
|
| 44 |
|
| 45 |
| Training Loss | Epoch | Step | Validation Loss |
|
| 46 |
|:-------------:|:-----:|:----:|:---------------:|
|
| 47 |
-
| 6.
|
| 48 |
-
| 6.
|
| 49 |
-
| 6.
|
| 50 |
|
| 51 |
|
| 52 |
### Framework versions
|
|
|
|
| 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.1179
|
| 17 |
|
| 18 |
## Model description
|
| 19 |
|
|
|
|
| 44 |
|
| 45 |
| Training Loss | Epoch | Step | Validation Loss |
|
| 46 |
|:-------------:|:-----:|:----:|:---------------:|
|
| 47 |
+
| 6.5492 | 1.0 | 2249 | 6.4721 |
|
| 48 |
+
| 6.1947 | 2.0 | 4498 | 6.2028 |
|
| 49 |
+
| 6.0174 | 3.0 | 6747 | 6.1179 |
|
| 50 |
|
| 51 |
|
| 52 |
### Framework versions
|
runs/Jan29_17-51-12_bb709d1098cd/events.out.tfevents.1706550673.bb709d1098cd.176.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:2995d0635d67c74e30d54452bffebe99e0a9afa0ceec44968db0faa0e6678063
|
| 3 |
+
size 7710
|
runs/Jan29_17-51-12_bb709d1098cd/events.out.tfevents.1706553107.bb709d1098cd.176.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:627b1796fae0dab838a338e29b10574c767bb5a552990677ce1ffe4b26eb2199
|
| 3 |
+
size 630
|