Instructions to use iproskurina/opt-2.7b-GPTQ-4bit-g128 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iproskurina/opt-2.7b-GPTQ-4bit-g128 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="iproskurina/opt-2.7b-GPTQ-4bit-g128")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("iproskurina/opt-2.7b-GPTQ-4bit-g128") model = AutoModelForCausalLM.from_pretrained("iproskurina/opt-2.7b-GPTQ-4bit-g128", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use iproskurina/opt-2.7b-GPTQ-4bit-g128 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "iproskurina/opt-2.7b-GPTQ-4bit-g128" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iproskurina/opt-2.7b-GPTQ-4bit-g128", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/iproskurina/opt-2.7b-GPTQ-4bit-g128
- SGLang
How to use iproskurina/opt-2.7b-GPTQ-4bit-g128 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 "iproskurina/opt-2.7b-GPTQ-4bit-g128" \ --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": "iproskurina/opt-2.7b-GPTQ-4bit-g128", "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 "iproskurina/opt-2.7b-GPTQ-4bit-g128" \ --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": "iproskurina/opt-2.7b-GPTQ-4bit-g128", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use iproskurina/opt-2.7b-GPTQ-4bit-g128 with Docker Model Runner:
docker model run hf.co/iproskurina/opt-2.7b-GPTQ-4bit-g128
Update README.md
Browse files
README.md
CHANGED
|
@@ -38,13 +38,25 @@ The grouping size used for quantization is equal to 128.
|
|
| 38 |
|
| 39 |
### Install the necessary packages
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
```shell
|
| 42 |
-
|
| 43 |
-
git clone https://github.com/
|
| 44 |
cd AutoGPTQ
|
| 45 |
-
|
|
|
|
| 46 |
```
|
| 47 |
-
Recommended transformers version: 4.35.2.
|
| 48 |
|
| 49 |
### You can then use the following code
|
| 50 |
|
|
|
|
| 38 |
|
| 39 |
### Install the necessary packages
|
| 40 |
|
| 41 |
+
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
| 42 |
+
|
| 43 |
+
```shell
|
| 44 |
+
pip3 install --upgrade transformers optimum
|
| 45 |
+
# If using PyTorch 2.1 + CUDA 12.x:
|
| 46 |
+
pip3 install --upgrade auto-gptq
|
| 47 |
+
# or, if using PyTorch 2.1 + CUDA 11.x:
|
| 48 |
+
pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
If you are using PyTorch 2.0, you will need to install AutoGPTQ from source. Likewise if you have problems with the pre-built wheels, you should try building from source:
|
| 52 |
+
|
| 53 |
```shell
|
| 54 |
+
pip3 uninstall -y auto-gptq
|
| 55 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
| 56 |
cd AutoGPTQ
|
| 57 |
+
git checkout v0.5.1
|
| 58 |
+
pip3 install .
|
| 59 |
```
|
|
|
|
| 60 |
|
| 61 |
### You can then use the following code
|
| 62 |
|