Instructions to use Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k") model = AutoModelForCausalLM.from_pretrained("Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k
- SGLang
How to use Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k 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 "Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k" \ --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": "Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k", "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 "Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k" \ --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": "Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k with Docker Model Runner:
docker model run hf.co/Jiaqi1Song/llama-2-7b-int4-GPTQ-python-code-20k
Upload of AutoGPTQ quantized model
Browse files- config.json +52 -0
- gptq_model-4bit-128g.safetensors +3 -0
- quantize_config.json +13 -0
- special_tokens_map.json +3 -21
- tokenizer.json +1 -6
config.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "gpt2",
|
| 3 |
+
"activation_function": "gelu_new",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"GPT2LMHeadModel"
|
| 6 |
+
],
|
| 7 |
+
"attn_pdrop": 0.1,
|
| 8 |
+
"bos_token_id": 50256,
|
| 9 |
+
"embd_pdrop": 0.1,
|
| 10 |
+
"eos_token_id": 50256,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"layer_norm_epsilon": 1e-05,
|
| 13 |
+
"model_type": "gpt2",
|
| 14 |
+
"n_ctx": 1024,
|
| 15 |
+
"n_embd": 768,
|
| 16 |
+
"n_head": 12,
|
| 17 |
+
"n_inner": null,
|
| 18 |
+
"n_layer": 12,
|
| 19 |
+
"n_positions": 1024,
|
| 20 |
+
"quantization_config": {
|
| 21 |
+
"bits": 4,
|
| 22 |
+
"damp_percent": 0.01,
|
| 23 |
+
"desc_act": false,
|
| 24 |
+
"group_size": 128,
|
| 25 |
+
"is_marlin_format": false,
|
| 26 |
+
"model_file_base_name": null,
|
| 27 |
+
"model_name_or_path": null,
|
| 28 |
+
"quant_method": "gptq",
|
| 29 |
+
"static_groups": false,
|
| 30 |
+
"sym": true,
|
| 31 |
+
"true_sequential": true
|
| 32 |
+
},
|
| 33 |
+
"reorder_and_upcast_attn": false,
|
| 34 |
+
"resid_pdrop": 0.1,
|
| 35 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 36 |
+
"scale_attn_weights": true,
|
| 37 |
+
"summary_activation": null,
|
| 38 |
+
"summary_first_dropout": 0.1,
|
| 39 |
+
"summary_proj_to_labels": true,
|
| 40 |
+
"summary_type": "cls_index",
|
| 41 |
+
"summary_use_proj": true,
|
| 42 |
+
"task_specific_params": {
|
| 43 |
+
"text-generation": {
|
| 44 |
+
"do_sample": true,
|
| 45 |
+
"max_length": 50
|
| 46 |
+
}
|
| 47 |
+
},
|
| 48 |
+
"torch_dtype": "float16",
|
| 49 |
+
"transformers_version": "4.37.2",
|
| 50 |
+
"use_cache": true,
|
| 51 |
+
"vocab_size": 50257
|
| 52 |
+
}
|
gptq_model-4bit-128g.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9a5b5a91b41d4d1e27c3518e5d9838d61509983c921afccb7b1e9548dbf28aae
|
| 3 |
+
size 200619312
|
quantize_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bits": 4,
|
| 3 |
+
"group_size": 128,
|
| 4 |
+
"damp_percent": 0.01,
|
| 5 |
+
"desc_act": false,
|
| 6 |
+
"static_groups": false,
|
| 7 |
+
"sym": true,
|
| 8 |
+
"true_sequential": true,
|
| 9 |
+
"model_name_or_path": null,
|
| 10 |
+
"model_file_base_name": null,
|
| 11 |
+
"is_marlin_format": false,
|
| 12 |
+
"quant_method": "gptq"
|
| 13 |
+
}
|
special_tokens_map.json
CHANGED
|
@@ -1,23 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"bos_token":
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
"normalized": true,
|
| 6 |
-
"rstrip": false,
|
| 7 |
-
"single_word": false
|
| 8 |
-
},
|
| 9 |
-
"eos_token": {
|
| 10 |
-
"content": "<|endoftext|>",
|
| 11 |
-
"lstrip": false,
|
| 12 |
-
"normalized": true,
|
| 13 |
-
"rstrip": false,
|
| 14 |
-
"single_word": false
|
| 15 |
-
},
|
| 16 |
-
"unk_token": {
|
| 17 |
-
"content": "<|endoftext|>",
|
| 18 |
-
"lstrip": false,
|
| 19 |
-
"normalized": true,
|
| 20 |
-
"rstrip": false,
|
| 21 |
-
"single_word": false
|
| 22 |
-
}
|
| 23 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token": "<|endoftext|>",
|
| 3 |
+
"eos_token": "<|endoftext|>",
|
| 4 |
+
"unk_token": "<|endoftext|>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
}
|
tokenizer.json
CHANGED
|
@@ -1,11 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
-
"truncation":
|
| 4 |
-
"direction": "Right",
|
| 5 |
-
"max_length": 50,
|
| 6 |
-
"strategy": "LongestFirst",
|
| 7 |
-
"stride": 0
|
| 8 |
-
},
|
| 9 |
"padding": null,
|
| 10 |
"added_tokens": [
|
| 11 |
{
|
|
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
+
"truncation": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
"padding": null,
|
| 5 |
"added_tokens": [
|
| 6 |
{
|