pszemraj/simple_wikipedia_LM
Viewer • Updated • 476k • 82 • 13
How to use pszemraj/pythia-31m-simplewiki-scratch-bf16 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="pszemraj/pythia-31m-simplewiki-scratch-bf16") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("pszemraj/pythia-31m-simplewiki-scratch-bf16")
model = AutoModelForCausalLM.from_pretrained("pszemraj/pythia-31m-simplewiki-scratch-bf16", device_map="auto")How to use pszemraj/pythia-31m-simplewiki-scratch-bf16 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "pszemraj/pythia-31m-simplewiki-scratch-bf16"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "pszemraj/pythia-31m-simplewiki-scratch-bf16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/pszemraj/pythia-31m-simplewiki-scratch-bf16
How to use pszemraj/pythia-31m-simplewiki-scratch-bf16 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "pszemraj/pythia-31m-simplewiki-scratch-bf16" \
--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": "pszemraj/pythia-31m-simplewiki-scratch-bf16",
"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 "pszemraj/pythia-31m-simplewiki-scratch-bf16" \
--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": "pszemraj/pythia-31m-simplewiki-scratch-bf16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use pszemraj/pythia-31m-simplewiki-scratch-bf16 with Docker Model Runner:
docker model run hf.co/pszemraj/pythia-31m-simplewiki-scratch-bf16
Trained from random initialized config based on EleutherAI/pythia-31m, 3 epochs bf16 It achieves the following results on the evaluation set:
tuned with bf16 (previous was fp32)
More information needed
***** eval metrics *****
epoch = 2.99
eval_accuracy = 0.3723 eval_loss = 4.1155
eval_runtime = 0:00:14.44
eval_samples = 500 eval_samples_per_second = 34.602 eval_steps_per_second = 17.301
perplexity = 61.2811
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 5.8617 | 0.45 | 100 | 5.5276 | 0.2451 |
| 5.2782 | 0.9 | 200 | 4.9596 | 0.2965 |
| 4.9996 | 1.35 | 300 | 4.6412 | 0.3310 |
| 4.6292 | 1.8 | 400 | 4.4344 | 0.3485 |
| 4.5339 | 2.25 | 500 | 4.2875 | 0.3600 |
| 4.5214 | 2.7 | 600 | 4.1763 | 0.3676 |
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 24.63 |
| ARC (25-shot) | 22.78 |
| HellaSwag (10-shot) | 25.61 |
| MMLU (5-shot) | 23.12 |
| TruthfulQA (0-shot) | 49.65 |
| Winogrande (5-shot) | 50.51 |
| GSM8K (5-shot) | 0.0 |
| DROP (3-shot) | 0.72 |