Instructions to use dnarqq/gpt2-wikitext2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dnarqq/gpt2-wikitext2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dnarqq/gpt2-wikitext2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dnarqq/gpt2-wikitext2") model = AutoModelForCausalLM.from_pretrained("dnarqq/gpt2-wikitext2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dnarqq/gpt2-wikitext2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dnarqq/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": "dnarqq/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dnarqq/gpt2-wikitext2
- SGLang
How to use dnarqq/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 "dnarqq/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": "dnarqq/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 "dnarqq/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": "dnarqq/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dnarqq/gpt2-wikitext2 with Docker Model Runner:
docker model run hf.co/dnarqq/gpt2-wikitext2
End of training
Browse files- README.md +4 -4
- pytorch_model.bin +1 -1
README.md
CHANGED
|
@@ -15,7 +15,7 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 15 |
|
| 16 |
This model is a fine-tuned version of [gpt2](https://huggingface.co/gpt2) on the None dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
-
- Loss:
|
| 19 |
|
| 20 |
## Model description
|
| 21 |
|
|
@@ -46,9 +46,9 @@ The following hyperparameters were used during training:
|
|
| 46 |
|
| 47 |
| Training Loss | Epoch | Step | Validation Loss |
|
| 48 |
|:-------------:|:-----:|:----:|:---------------:|
|
| 49 |
-
| No log | 1.0 | 119 |
|
| 50 |
-
| No log | 2.0 | 238 |
|
| 51 |
-
| No log | 3.0 | 357 |
|
| 52 |
|
| 53 |
|
| 54 |
### Framework versions
|
|
|
|
| 15 |
|
| 16 |
This model is a fine-tuned version of [gpt2](https://huggingface.co/gpt2) on the None dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
+
- Loss: 4.6417
|
| 19 |
|
| 20 |
## Model description
|
| 21 |
|
|
|
|
| 46 |
|
| 47 |
| Training Loss | Epoch | Step | Validation Loss |
|
| 48 |
|:-------------:|:-----:|:----:|:---------------:|
|
| 49 |
+
| No log | 1.0 | 119 | 5.0447 |
|
| 50 |
+
| No log | 2.0 | 238 | 4.7462 |
|
| 51 |
+
| No log | 3.0 | 357 | 4.6417 |
|
| 52 |
|
| 53 |
|
| 54 |
### Framework versions
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 497807706
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9d56728ff978f34b243acbb342905428000be53143f2502e2e612130c8dc82c9
|
| 3 |
size 497807706
|