Instructions to use Jayfeather1024/sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jayfeather1024/sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jayfeather1024/sft")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Jayfeather1024/sft") model = AutoModelForCausalLM.from_pretrained("Jayfeather1024/sft", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jayfeather1024/sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jayfeather1024/sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jayfeather1024/sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Jayfeather1024/sft
- SGLang
How to use Jayfeather1024/sft 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 "Jayfeather1024/sft" \ --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": "Jayfeather1024/sft", "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 "Jayfeather1024/sft" \ --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": "Jayfeather1024/sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Jayfeather1024/sft with Docker Model Runner:
docker model run hf.co/Jayfeather1024/sft
| { | |
| "model_name_or_path": "huggyllama/llama-7b", | |
| "max_length": 512, | |
| "trust_remote_code": true, | |
| "train_datasets": [ | |
| [ | |
| "alpaca", | |
| { | |
| "proportion": 1.0 | |
| } | |
| ] | |
| ], | |
| "eval_datasets": null, | |
| "epochs": 3, | |
| "per_device_train_batch_size": 4, | |
| "per_device_eval_batch_size": 4, | |
| "gradient_accumulation_steps": 16, | |
| "gradient_checkpointing": true, | |
| "lr": 2e-05, | |
| "lr_scheduler_type": "cosine", | |
| "lr_warmup_ratio": 0.03, | |
| "weight_decay": 0.0, | |
| "seed": 42, | |
| "fp16": false, | |
| "bf16": true, | |
| "tf32": true, | |
| "eval_strategy": "epoch", | |
| "eval_interval": 1000000, | |
| "need_eval": false, | |
| "eval_split_ratio": null, | |
| "output_dir": "/data/jiongxiao_wang/rlhf_attack/safe-rlhf/output/sft", | |
| "log_type": "wandb", | |
| "log_dir": "/data/jiongxiao_wang/rlhf_attack/safe-rlhf/output/sft", | |
| "log_project": "Safe-RLHF-SFT", | |
| "log_run_name": "sft-2023-12-31-20-07-40", | |
| "save_16bit": false, | |
| "save_interval": 1000000, | |
| "local_rank": 0, | |
| "zero_stage": 3, | |
| "deepspeed": false, | |
| "deepspeed_config": null, | |
| "deepscale": false, | |
| "deepscale_config": null, | |
| "deepspeed_mpi": false, | |
| "global_rank": 0, | |
| "device": { | |
| "type": "torch.device", | |
| "repr": "device(type='cuda', index=0)" | |
| }, | |
| "num_update_steps_per_epoch": 204, | |
| "total_training_steps": 612 | |
| } |