rexarski/eli5_category
Updated • 554 • 19
How to use koh43/distilgpt2-eli5-clm with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="koh43/distilgpt2-eli5-clm") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("koh43/distilgpt2-eli5-clm")
model = AutoModelForCausalLM.from_pretrained("koh43/distilgpt2-eli5-clm")How to use koh43/distilgpt2-eli5-clm with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "koh43/distilgpt2-eli5-clm"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "koh43/distilgpt2-eli5-clm",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/koh43/distilgpt2-eli5-clm
How to use koh43/distilgpt2-eli5-clm with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "koh43/distilgpt2-eli5-clm" \
--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": "koh43/distilgpt2-eli5-clm",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "koh43/distilgpt2-eli5-clm" \
--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": "koh43/distilgpt2-eli5-clm",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use koh43/distilgpt2-eli5-clm with Docker Model Runner:
docker model run hf.co/koh43/distilgpt2-eli5-clm
This model is a fine-tuned version of distilbert/distilgpt2 on the eli5_category dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 3.9079 | 1.0 | 1314 | 3.8563 |
| 3.8119 | 2.0 | 2628 | 3.8461 |
| 3.7662 | 3.0 | 3942 | 3.8420 |
| 3.7062 | 4.0 | 5256 | 3.8437 |
| 3.6726 | 5.0 | 6570 | 3.8460 |
| 3.639 | 6.0 | 7884 | 3.8462 |
| 3.6229 | 7.0 | 9198 | 3.8533 |
| 3.5963 | 8.0 | 10512 | 3.8549 |
| 3.582 | 9.0 | 11826 | 3.8573 |
| 3.5798 | 10.0 | 13140 | 3.8586 |
Base model
distilbert/distilgpt2