Instructions to use michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps
- SGLang
How to use michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps 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 "michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps" \ --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": "michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps", "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 "michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps" \ --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": "michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps with Docker Model Runner:
docker model run hf.co/michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps
# Fast-Inference with Ctranslate2
Speedup inference while reducing memory by 2x-4x using int8 inference in C++ on CPU or GPU.
quantized version of OpenAssistant/pythia-12b-sft-v8-7k-steps
pip install hf-hub-ctranslate2>=2.0.6
Converted on 2023-05-19 using
ct2-transformers-converter --model OpenAssistant/pythia-12b-sft-v8-7k-steps --output_dir /home/feil_m/tmp-ct2fast-pythia-12b-sft-v8-7k-steps --force --copy_files tokenizer.json README.md tokenizer_config.json generation_config.json special_tokens_map.json .gitattributes --quantization float16
Checkpoint compatible to ctranslate2>=3.13.0 and hf-hub-ctranslate2>=2.0.6
compute_type=int8_float16fordevice="cuda"compute_type=int8fordevice="cpu"
from hf_hub_ctranslate2 import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub
from transformers import AutoTokenizer
model_name = "michaelfeil/ct2fast-pythia-12b-sft-v8-7k-steps"
# use either TranslatorCT2fromHfHub or GeneratorCT2fromHfHub here, depending on model.
model = GeneratorCT2fromHfHub(
# load in int8 on CUDA
model_name_or_path=model_name,
device="cuda",
compute_type="int8_float16",
tokenizer=AutoTokenizer.from_pretrained("OpenAssistant/pythia-12b-sft-v8-7k-steps")
)
outputs = model.generate(
text=["How do you call a fast Flan-ingo?", "User: How are you doing? Bot:"],
)
print(outputs)
Licence and other remarks:
This is just a quantized version. Licence conditions are intended to be idential to original huggingface repo.
Original description
- base model: OpenAssistant/pythia-12b-pre-v8-12.5k-steps
- wandb: https://wandb.ai/open-assistant/supervised-finetuning/runs/pcw1ejda
- sampling report
pythia-12b-sft-8:
dtype: fp16
log_dir: "pythia_log_12b"
learning_rate: 6e-6
model_name: OpenAssistant/pythia-12b-pre-v8-12.5k-steps
output_dir: pythia_model_12b
weight_decay: 0.0
residual_dropout: 0.0
max_length: 2048
use_flash_attention: true
warmup_steps: 100
gradient_checkpointing: true
gradient_accumulation_steps: 2
per_device_train_batch_size: 4
per_device_eval_batch_size: 4
eval_steps: 251
save_steps: 500
num_train_epochs: 8
save_total_limit: 4
num_train_epochs: 8
save_total_limit: 3
use_custom_sampler: true
sort_by_length: false
save_strategy: steps
datasets:
- oasst_export:
lang: "bg,ca,cs,da,de,en,es,fr,hr,hu,it,nl,pl,pt,ro,ru,sl,sr,sv,uk"
input_file_path: 2023-05-06_OASST_labels.jsonl.gz
val_split: 0.05
- vicuna:
val_split: 0.05
max_val_set: 800
fraction: 0.4
- dolly15k:
val_split: 0.05
max_val_set: 300
- grade_school_math_instructions:
val_split: 0.05
- code_alpaca:
val_split: 0.05
max_val_set: 250
- red_pajama:
fraction: 0.05
max_val_set: 1000
- wizardlm_70k:
val_split: 0.05
max_val_set: 500
fraction: 0.4
- poem_instructions:
fraction: 0.5
val_split: 0.025
- Downloads last month
- 11