Instructions to use andreaskoepf/pythia-12b-pre-2000 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use andreaskoepf/pythia-12b-pre-2000 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="andreaskoepf/pythia-12b-pre-2000")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("andreaskoepf/pythia-12b-pre-2000") model = AutoModelForCausalLM.from_pretrained("andreaskoepf/pythia-12b-pre-2000") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use andreaskoepf/pythia-12b-pre-2000 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "andreaskoepf/pythia-12b-pre-2000" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "andreaskoepf/pythia-12b-pre-2000", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/andreaskoepf/pythia-12b-pre-2000
- SGLang
How to use andreaskoepf/pythia-12b-pre-2000 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 "andreaskoepf/pythia-12b-pre-2000" \ --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": "andreaskoepf/pythia-12b-pre-2000", "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 "andreaskoepf/pythia-12b-pre-2000" \ --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": "andreaskoepf/pythia-12b-pre-2000", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use andreaskoepf/pythia-12b-pre-2000 with Docker Model Runner:
docker model run hf.co/andreaskoepf/pythia-12b-pre-2000
New run with DeepSpeed 0.7.7 and transformers 4.26.1, (using WarmupDecayLR, probably not optimal).
wandb run: https://wandb.ai/open-assistant/supervised-finetuning/runs/bxyaxo4v Checkpoint: 2000 steps ~48% 1st epoch
Datasets:
pretrain:
use_custom_sampler: true
sort_by_length: false
datasets:
- joke
- webgpt:
val_split: 0.1
- gpt4all:
val_split: 0.01
- alpaca:
val_split: 0.025
- code_alpaca:
val_split: 0.05
- minimath
- humaneval_mbpp_codegen_qa
- humaneval_mbpp_testgen_qa
- grade_school_math_instructions
- recipes
- cmu_wiki_qa
#- youtube_subs_howto100m # uses incompatible column names
#- ubuntu_dialogue_qa # fails to load
- oa_wiki_qa_bart_10000row
- prosocial_dialogue:
fraction: 0.1
- explain_prosocial:
fraction: 0.05
Pythia:
pythia-12b:
dtype: fp16
log_dir: "pythia_log_12b"
learning_rate: 6e-6
model_name: EleutherAI/pythia-12b-deduped
output_dir: pythia_model_12b
weight_decay: 0.0
max_length: 2048
use_flash_attention: true
deepspeed_config: configs/zero_conf2.json
warmup_steps: 50
gradient_checkpointing: true
gradient_accumulation_steps: 2
per_device_train_batch_size: 8
per_device_eval_batch_size: 5
eval_steps: 200
save_steps: 500
num_train_epochs: 2
save_total_limit: 2
zero_conf2.json:
{
"fp16": {
"enabled": "auto",
"loss_scale": 0,
"loss_scale_window": 1000,
"initial_scale_power": 16,
"hysteresis": 2,
"min_loss_scale": 1
},
"bf16": {
"enabled": "auto"
},
"optimizer": {
"type": "AdamW",
"params": {
"lr": "auto",
"betas": "auto",
"eps": "auto",
"weight_decay": "auto"
}
},
"scheduler": {
"type": "WarmupDecayLR",
"params": {
"warmup_min_lr": "auto",
"warmup_max_lr": "auto",
"warmup_num_steps": "auto",
"total_num_steps": "auto"
}
},
"zero_optimization": {
"stage": 2,
"allgather_partitions": true,
"allgather_bucket_size": 1000000000.0,
"overlap_comm": false,
"reduce_scatter": true,
"reduce_bucket_size": 1000000000.0,
"contiguous_gradients": true
},
"gradient_accumulation_steps": "auto",
"gradient_clipping": "auto",
"steps_per_print": 2000,
"train_batch_size": "auto",
"train_micro_batch_size_per_gpu": "auto",
"wall_clock_breakdown": false
}
- Downloads last month
- 11