Instructions to use pigas/phi-2-GPTQ-4bits with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pigas/phi-2-GPTQ-4bits with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pigas/phi-2-GPTQ-4bits")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pigas/phi-2-GPTQ-4bits") model = AutoModelForCausalLM.from_pretrained("pigas/phi-2-GPTQ-4bits") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pigas/phi-2-GPTQ-4bits with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pigas/phi-2-GPTQ-4bits" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pigas/phi-2-GPTQ-4bits", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pigas/phi-2-GPTQ-4bits
- SGLang
How to use pigas/phi-2-GPTQ-4bits 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 "pigas/phi-2-GPTQ-4bits" \ --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": "pigas/phi-2-GPTQ-4bits", "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 "pigas/phi-2-GPTQ-4bits" \ --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": "pigas/phi-2-GPTQ-4bits", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use pigas/phi-2-GPTQ-4bits with Docker Model Runner:
docker model run hf.co/pigas/phi-2-GPTQ-4bits
Upload PhiForCausalLM
Browse files- config.json +24 -0
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -19,6 +19,30 @@
|
|
| 19 |
"num_key_value_heads": 32,
|
| 20 |
"partial_rotary_factor": 0.4,
|
| 21 |
"qk_layernorm": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
"resid_pdrop": 0.1,
|
| 23 |
"rope_scaling": null,
|
| 24 |
"rope_theta": 10000.0,
|
|
|
|
| 19 |
"num_key_value_heads": 32,
|
| 20 |
"partial_rotary_factor": 0.4,
|
| 21 |
"qk_layernorm": false,
|
| 22 |
+
"quantization_config": {
|
| 23 |
+
"batch_size": 1,
|
| 24 |
+
"bits": 4,
|
| 25 |
+
"block_name_to_quantize": null,
|
| 26 |
+
"cache_block_outputs": true,
|
| 27 |
+
"damp_percent": 0.1,
|
| 28 |
+
"dataset": "c4",
|
| 29 |
+
"desc_act": false,
|
| 30 |
+
"exllama_config": {
|
| 31 |
+
"version": 1
|
| 32 |
+
},
|
| 33 |
+
"group_size": 128,
|
| 34 |
+
"max_input_length": null,
|
| 35 |
+
"model_seqlen": null,
|
| 36 |
+
"module_name_preceding_first_block": null,
|
| 37 |
+
"modules_in_block_to_quantize": null,
|
| 38 |
+
"pad_token_id": null,
|
| 39 |
+
"quant_method": "gptq",
|
| 40 |
+
"sym": true,
|
| 41 |
+
"tokenizer": null,
|
| 42 |
+
"true_sequential": true,
|
| 43 |
+
"use_cuda_fp16": false,
|
| 44 |
+
"use_exllama": true
|
| 45 |
+
},
|
| 46 |
"resid_pdrop": 0.1,
|
| 47 |
"rope_scaling": null,
|
| 48 |
"rope_theta": 10000.0,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6bc9a7ab5c39038a0e3af61847a6ecce0c2a30ba28518fde79043b51811db6d7
|
| 3 |
+
size 1836707464
|