Instructions to use Rocketknight1/gpt2-finetuned-wikitext2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Rocketknight1/gpt2-finetuned-wikitext2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Rocketknight1/gpt2-finetuned-wikitext2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Rocketknight1/gpt2-finetuned-wikitext2") model = AutoModelForCausalLM.from_pretrained("Rocketknight1/gpt2-finetuned-wikitext2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Rocketknight1/gpt2-finetuned-wikitext2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rocketknight1/gpt2-finetuned-wikitext2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rocketknight1/gpt2-finetuned-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Rocketknight1/gpt2-finetuned-wikitext2
- SGLang
How to use Rocketknight1/gpt2-finetuned-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 "Rocketknight1/gpt2-finetuned-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": "Rocketknight1/gpt2-finetuned-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 "Rocketknight1/gpt2-finetuned-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": "Rocketknight1/gpt2-finetuned-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Rocketknight1/gpt2-finetuned-wikitext2 with Docker Model Runner:
docker model run hf.co/Rocketknight1/gpt2-finetuned-wikitext2
Commit ·
456b3c6
1
Parent(s): 0e32896
Training in progress epoch 0
Browse files- README.md +7 -8
- config.json +1 -1
- special_tokens_map.json +5 -1
- tf_model.h5 +1 -1
- tokenizer_config.json +10 -1
README.md
CHANGED
|
@@ -14,9 +14,9 @@ probably proofread and complete it, then remove this comment. -->
|
|
| 14 |
|
| 15 |
This model is a fine-tuned version of [gpt2](https://huggingface.co/gpt2) on an unknown dataset.
|
| 16 |
It achieves the following results on the evaluation set:
|
| 17 |
-
- Train Loss:
|
| 18 |
-
- Validation Loss: 6.
|
| 19 |
-
- Epoch:
|
| 20 |
|
| 21 |
## Model description
|
| 22 |
|
|
@@ -42,13 +42,12 @@ The following hyperparameters were used during training:
|
|
| 42 |
|
| 43 |
| Train Loss | Validation Loss | Epoch |
|
| 44 |
|:----------:|:---------------:|:-----:|
|
| 45 |
-
| 7.
|
| 46 |
-
| 6.4978 | 6.3516 | 1 |
|
| 47 |
|
| 48 |
|
| 49 |
### Framework versions
|
| 50 |
|
| 51 |
-
- Transformers 4.
|
| 52 |
-
- TensorFlow 2.
|
| 53 |
-
- Datasets 2.
|
| 54 |
- Tokenizers 0.11.0
|
|
|
|
| 14 |
|
| 15 |
This model is a fine-tuned version of [gpt2](https://huggingface.co/gpt2) on an unknown dataset.
|
| 16 |
It achieves the following results on the evaluation set:
|
| 17 |
+
- Train Loss: 7.3123
|
| 18 |
+
- Validation Loss: 6.7670
|
| 19 |
+
- Epoch: 0
|
| 20 |
|
| 21 |
## Model description
|
| 22 |
|
|
|
|
| 42 |
|
| 43 |
| Train Loss | Validation Loss | Epoch |
|
| 44 |
|:----------:|:---------------:|:-----:|
|
| 45 |
+
| 7.3123 | 6.7670 | 0 |
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
### Framework versions
|
| 49 |
|
| 50 |
+
- Transformers 4.21.0.dev0
|
| 51 |
+
- TensorFlow 2.9.1
|
| 52 |
+
- Datasets 2.3.3.dev0
|
| 53 |
- Tokenizers 0.11.0
|
config.json
CHANGED
|
@@ -32,7 +32,7 @@
|
|
| 32 |
"max_length": 50
|
| 33 |
}
|
| 34 |
},
|
| 35 |
-
"transformers_version": "4.
|
| 36 |
"use_cache": true,
|
| 37 |
"vocab_size": 50257
|
| 38 |
}
|
|
|
|
| 32 |
"max_length": 50
|
| 33 |
}
|
| 34 |
},
|
| 35 |
+
"transformers_version": "4.21.0.dev0",
|
| 36 |
"use_cache": true,
|
| 37 |
"vocab_size": 50257
|
| 38 |
}
|
special_tokens_map.json
CHANGED
|
@@ -1 +1,5 @@
|
|
| 1 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<|endoftext|>",
|
| 3 |
+
"eos_token": "<|endoftext|>",
|
| 4 |
+
"unk_token": "<|endoftext|>"
|
| 5 |
+
}
|
tf_model.h5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 497935464
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d58b5446148b73d2c8cfc62cc0990f00fd46a64a4e84e74b84749995333b1034
|
| 3 |
size 497935464
|
tokenizer_config.json
CHANGED
|
@@ -1 +1,10 @@
|
|
| 1 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"bos_token": "<|endoftext|>",
|
| 4 |
+
"eos_token": "<|endoftext|>",
|
| 5 |
+
"model_max_length": 1024,
|
| 6 |
+
"name_or_path": "sgugger/gpt2-like-tokenizer",
|
| 7 |
+
"special_tokens_map_file": null,
|
| 8 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 9 |
+
"unk_token": "<|endoftext|>"
|
| 10 |
+
}
|