Instructions to use nitwof/saiga2_7b_lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nitwof/saiga2_7b_lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nitwof/saiga2_7b_lora")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nitwof/saiga2_7b_lora") model = AutoModelForCausalLM.from_pretrained("nitwof/saiga2_7b_lora") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nitwof/saiga2_7b_lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nitwof/saiga2_7b_lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nitwof/saiga2_7b_lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nitwof/saiga2_7b_lora
- SGLang
How to use nitwof/saiga2_7b_lora 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 "nitwof/saiga2_7b_lora" \ --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": "nitwof/saiga2_7b_lora", "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 "nitwof/saiga2_7b_lora" \ --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": "nitwof/saiga2_7b_lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nitwof/saiga2_7b_lora with Docker Model Runner:
docker model run hf.co/nitwof/saiga2_7b_lora
| { | |
| "trainer": { | |
| "evaluation_strategy": "steps", | |
| "per_device_train_batch_size": 1, | |
| "per_device_eval_batch_size": 1, | |
| "gradient_accumulation_steps": 128, | |
| "eval_steps": 50, | |
| "save_steps": 50, | |
| "logging_steps": 2, | |
| "learning_rate": 0.0003, | |
| "num_train_epochs": 5, | |
| "lr_scheduler_type": "cosine", | |
| "warmup_steps": 50, | |
| "fp16": false, | |
| "bf16": true, | |
| "torch_compile": false, | |
| "optim": "adamw_torch" | |
| }, | |
| "lora": { | |
| "r": 16, | |
| "lora_alpha": 16, | |
| "lora_dropout": 0.05, | |
| "bias": "none", | |
| "target_modules": ["q_proj", "v_proj", "k_proj", "o_proj"], | |
| "task_type": "CAUSAL_LM" | |
| }, | |
| "load_in_8bit": true, | |
| "only_target_loss": true, | |
| "mode": "chat", | |
| "templates_path": "internal_prompts/saiga_v2.json", | |
| "model_name": "models/llama2-7b", | |
| "model_type": "causal", | |
| "max_tokens_count": 4096 | |
| } | |