Back to Basics
Collection
A collection of "Back to Basics" models/aretfacts • 3 items • Updated
How to use sbartlett97/test_eli5_clm-model with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="sbartlett97/test_eli5_clm-model") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("sbartlett97/test_eli5_clm-model")
model = AutoModelForCausalLM.from_pretrained("sbartlett97/test_eli5_clm-model")How to use sbartlett97/test_eli5_clm-model with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "sbartlett97/test_eli5_clm-model"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "sbartlett97/test_eli5_clm-model",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/sbartlett97/test_eli5_clm-model
How to use sbartlett97/test_eli5_clm-model with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "sbartlett97/test_eli5_clm-model" \
--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": "sbartlett97/test_eli5_clm-model",
"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 "sbartlett97/test_eli5_clm-model" \
--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": "sbartlett97/test_eli5_clm-model",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use sbartlett97/test_eli5_clm-model with Docker Model Runner:
docker model run hf.co/sbartlett97/test_eli5_clm-model
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("sbartlett97/test_eli5_clm-model")
model = AutoModelForCausalLM.from_pretrained("sbartlett97/test_eli5_clm-model")This model is a fine-tuned version of distilbert/distilgpt2 on the dany0407/eli5_category dataset, as part of the HuggingFace Casual Language modelling guide. It achieves the following results on the evaluation set:
Distil gpt2 fine-tuned on eli5 dataset
exploration and re-aquainting myself with fineruning/training at home
dany0407/eli5_category
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 3.9157 | 1.0 | 1325 | 3.8137 |
| 3.8203 | 2.0 | 2650 | 3.8041 |
| 3.7755 | 3.0 | 3975 | 3.8031 |
Base model
distilbert/distilgpt2
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sbartlett97/test_eli5_clm-model")