Instructions to use 4bit/llama-13b-3bit-gr128 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 4bit/llama-13b-3bit-gr128 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="4bit/llama-13b-3bit-gr128")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("4bit/llama-13b-3bit-gr128") model = AutoModelForCausalLM.from_pretrained("4bit/llama-13b-3bit-gr128") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use 4bit/llama-13b-3bit-gr128 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "4bit/llama-13b-3bit-gr128" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "4bit/llama-13b-3bit-gr128", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/4bit/llama-13b-3bit-gr128
- SGLang
How to use 4bit/llama-13b-3bit-gr128 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 "4bit/llama-13b-3bit-gr128" \ --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": "4bit/llama-13b-3bit-gr128", "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 "4bit/llama-13b-3bit-gr128" \ --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": "4bit/llama-13b-3bit-gr128", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use 4bit/llama-13b-3bit-gr128 with Docker Model Runner:
docker model run hf.co/4bit/llama-13b-3bit-gr128
thanks to wcde ❤
Browse files- README.md +1 -0
- config.json +17 -0
- generation_config.json +5 -0
- llama-13b-3bit-gr128.pt +3 -0
- special_tokens_map.json +1 -0
- tokenizer.model +3 -0
- tokenizer_config.json +5 -0
README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Generated with: --wbits 3 --groupsize 128 --true-sequential --new-eval --faster-kernel
|
config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"architectures": ["LLaMAForCausalLM"],
|
| 2 |
+
"bos_token_id": 0,
|
| 3 |
+
"eos_token_id": 1,
|
| 4 |
+
"hidden_act": "silu",
|
| 5 |
+
"hidden_size": 5120,
|
| 6 |
+
"intermediate_size": 13824,
|
| 7 |
+
"initializer_range": 0.02,
|
| 8 |
+
"max_sequence_length": 2048,
|
| 9 |
+
"model_type": "llama",
|
| 10 |
+
"num_attention_heads": 40,
|
| 11 |
+
"num_hidden_layers": 40,
|
| 12 |
+
"pad_token_id": -1,
|
| 13 |
+
"rms_norm_eps": 1e-06,
|
| 14 |
+
"torch_dtype": "float16",
|
| 15 |
+
"transformers_version": "4.27.0.dev0",
|
| 16 |
+
"use_cache": true,
|
| 17 |
+
"vocab_size": 32000}
|
generation_config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"_from_model_config": true,
|
| 2 |
+
"bos_token_id": 0,
|
| 3 |
+
"eos_token_id": 1,
|
| 4 |
+
"pad_token_id": 0,
|
| 5 |
+
"transformers_version": "4.27.0.dev0"}
|
llama-13b-3bit-gr128.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e8d2cb21bd3a9c14e2cad1f6f8ab2179c04a29e8e505acae957d129980dea933
|
| 3 |
+
size 5856740207
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{}
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
| 3 |
+
size 499723
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": "",
|
| 2 |
+
"eos_token": "",
|
| 3 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 4 |
+
"tokenizer_class": "LlamaTokenizer",
|
| 5 |
+
"unk_token": ""}
|