Instructions to use icity/distilgpt2-finetuned-wikitext2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use icity/distilgpt2-finetuned-wikitext2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="icity/distilgpt2-finetuned-wikitext2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("icity/distilgpt2-finetuned-wikitext2") model = AutoModelForCausalLM.from_pretrained("icity/distilgpt2-finetuned-wikitext2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use icity/distilgpt2-finetuned-wikitext2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "icity/distilgpt2-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": "icity/distilgpt2-finetuned-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/icity/distilgpt2-finetuned-wikitext2
- SGLang
How to use icity/distilgpt2-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 "icity/distilgpt2-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": "icity/distilgpt2-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 "icity/distilgpt2-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": "icity/distilgpt2-finetuned-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use icity/distilgpt2-finetuned-wikitext2 with Docker Model Runner:
docker model run hf.co/icity/distilgpt2-finetuned-wikitext2
Training in progress, step 500
Browse files
config.json
CHANGED
|
@@ -40,7 +40,7 @@
|
|
| 40 |
}
|
| 41 |
},
|
| 42 |
"torch_dtype": "float32",
|
| 43 |
-
"transformers_version": "4.
|
| 44 |
"use_cache": true,
|
| 45 |
"vocab_size": 50257
|
| 46 |
}
|
|
|
|
| 40 |
}
|
| 41 |
},
|
| 42 |
"torch_dtype": "float32",
|
| 43 |
+
"transformers_version": "4.21.0",
|
| 44 |
"use_cache": true,
|
| 45 |
"vocab_size": 50257
|
| 46 |
}
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 333967901
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8335bb8fb6802c7f85068e173ecb8083e05e8512e094f7948ae6f6a08e8a6dd8
|
| 3 |
size 333967901
|
runs/Jul28_11-58-06_c6c020ae4d8c/1659009583.166149/events.out.tfevents.1659009583.c6c020ae4d8c.59.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57c8454597819492e9ad1e2928c455e5144c1b2fb991eaea0966ead534b55bb4
|
| 3 |
+
size 5445
|
runs/Jul28_11-58-06_c6c020ae4d8c/events.out.tfevents.1659009583.c6c020ae4d8c.59.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d891060fb1256f8592c6385d5b2fe01e59399da8406de7a50d46dd58db1791fd
|
| 3 |
+
size 4187
|
training_args.bin
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:88054148f64ffac683fd7e56648d70f224ead9c96285c983c4c6c4a0c194e6c8
|
| 3 |
+
size 3375
|