Instructions to use nkpz/llama2-22b-blocktriangular-alpaca with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nkpz/llama2-22b-blocktriangular-alpaca with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nkpz/llama2-22b-blocktriangular-alpaca")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nkpz/llama2-22b-blocktriangular-alpaca") model = AutoModelForCausalLM.from_pretrained("nkpz/llama2-22b-blocktriangular-alpaca") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use nkpz/llama2-22b-blocktriangular-alpaca with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nkpz/llama2-22b-blocktriangular-alpaca" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nkpz/llama2-22b-blocktriangular-alpaca", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nkpz/llama2-22b-blocktriangular-alpaca
- SGLang
How to use nkpz/llama2-22b-blocktriangular-alpaca 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 "nkpz/llama2-22b-blocktriangular-alpaca" \ --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": "nkpz/llama2-22b-blocktriangular-alpaca", "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 "nkpz/llama2-22b-blocktriangular-alpaca" \ --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": "nkpz/llama2-22b-blocktriangular-alpaca", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nkpz/llama2-22b-blocktriangular-alpaca with Docker Model Runner:
docker model run hf.co/nkpz/llama2-22b-blocktriangular-alpaca
There is no official 22b model, this is just a weird experiment, and any potential benefits of doing this have not been validated
https://huggingface.co/chargoddard/llama2-22b-blocktriangular trained one one epoch of 52k rows of Stanford Alpaca. About 11 hours on a 3090.
I had trouble with training using the other 22b method with BLOCK_DIAGONAL=True as done in https://huggingface.co/chargoddard/llama2-22b, but with this method, this is the first time I've been able to target all modules without breaking the output.
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj", "up_proj", "gate_proj", "down_proj"]
Trained at 5e-5 with r=32. For more info see https://wandb.ai/nkpz/huggingface/runs/3oy5nbtv/workspace?workspace=user-nkpz
It's been responding coherently enough that I would need to run some objective benchmarks to determine if this is better/worse than stock llama 13b
- Downloads last month
- 18