Instructions to use modulora-repoducibility/llama-30b-4bit-quantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modulora-repoducibility/llama-30b-4bit-quantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="modulora-repoducibility/llama-30b-4bit-quantized")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("modulora-repoducibility/llama-30b-4bit-quantized") model = AutoModelForCausalLM.from_pretrained("modulora-repoducibility/llama-30b-4bit-quantized") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use modulora-repoducibility/llama-30b-4bit-quantized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modulora-repoducibility/llama-30b-4bit-quantized" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modulora-repoducibility/llama-30b-4bit-quantized", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/modulora-repoducibility/llama-30b-4bit-quantized
- SGLang
How to use modulora-repoducibility/llama-30b-4bit-quantized 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 "modulora-repoducibility/llama-30b-4bit-quantized" \ --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": "modulora-repoducibility/llama-30b-4bit-quantized", "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 "modulora-repoducibility/llama-30b-4bit-quantized" \ --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": "modulora-repoducibility/llama-30b-4bit-quantized", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use modulora-repoducibility/llama-30b-4bit-quantized with Docker Model Runner:
docker model run hf.co/modulora-repoducibility/llama-30b-4bit-quantized
Upload 3 files
Browse files- config.json +29 -0
- quant_config.json +11 -0
- quantized_weights.pt +3 -0
config.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "huggyllama/llama-30b",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 6656,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 17920,
|
| 13 |
+
"max_position_embeddings": 2048,
|
| 14 |
+
"max_sequence_length": 2048,
|
| 15 |
+
"model_type": "llama",
|
| 16 |
+
"num_attention_heads": 52,
|
| 17 |
+
"num_hidden_layers": 60,
|
| 18 |
+
"num_key_value_heads": 52,
|
| 19 |
+
"pad_token_id": 0,
|
| 20 |
+
"pretraining_tp": 1,
|
| 21 |
+
"rms_norm_eps": 1e-06,
|
| 22 |
+
"rope_scaling": null,
|
| 23 |
+
"rope_theta": 10000.0,
|
| 24 |
+
"tie_word_embeddings": false,
|
| 25 |
+
"torch_dtype": "float16",
|
| 26 |
+
"transformers_version": "4.34.0",
|
| 27 |
+
"use_cache": true,
|
| 28 |
+
"vocab_size": 32000
|
| 29 |
+
}
|
quant_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "c4",
|
| 3 |
+
"bits": 4,
|
| 4 |
+
"nsamples": 128,
|
| 5 |
+
"groupsize": 64,
|
| 6 |
+
"act_order": true,
|
| 7 |
+
"percdamp": 0.01,
|
| 8 |
+
"seed": 0,
|
| 9 |
+
"nearest": false,
|
| 10 |
+
"save": "./llama-30b-4bit-quantized"
|
| 11 |
+
}
|
quantized_weights.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:36f45e96508717659c25307b9deafe20f0b6230c2e0327a7aadadd6450e2f7d9
|
| 3 |
+
size 18173183861
|