Instructions to use TheBloke/starchat-beta-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/starchat-beta-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/starchat-beta-GPTQ")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TheBloke/starchat-beta-GPTQ") model = AutoModelForCausalLM.from_pretrained("TheBloke/starchat-beta-GPTQ", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TheBloke/starchat-beta-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheBloke/starchat-beta-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/starchat-beta-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TheBloke/starchat-beta-GPTQ
- SGLang
How to use TheBloke/starchat-beta-GPTQ 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 "TheBloke/starchat-beta-GPTQ" \ --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": "TheBloke/starchat-beta-GPTQ", "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 "TheBloke/starchat-beta-GPTQ" \ --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": "TheBloke/starchat-beta-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TheBloke/starchat-beta-GPTQ with Docker Model Runner:
docker model run hf.co/TheBloke/starchat-beta-GPTQ
Got an unexpected keyword argument 'model_name_or_path'
Using your example I got this error: TypeError: BaseQuantizeConfig.__init__() got an unexpected keyword argument 'model_name_or_path' on the line:
model = AutoGPTQForCausalLM.from_quantized(model_name_or_path, ...)
auto-gptq==0.2.2
nvidia-smi:
Fri Jun 30 14:18:18 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.105.01 Driver Version: 515.105.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:01:00.0 Off | N/A |
| 0% 24C P8 8W / 250W | 289MiB / 11264MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
+-----------------------------------------------------------------------------+
Does anybody know how to fix it?
What is your full script
from transformers import AutoTokenizer, pipeline, logging
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
use_triton = False
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
use_safetensors=True,
device="cuda:0",
use_triton=use_triton,
quantize_config=None)
You've only used a portion of the script and haven't defined model_name_or_path. Check the full script in the README
You've only used a portion of the script and haven't defined
model_name_or_path. Check the full script in the README
I defined model_name_or_path but forgot past it to the snippet I sent.
I got a similar error using text-geration-webui load of this model.
The error message: BaseQuantizeConfig.init() got an unexpected keyword argument ‘model_name_or_path’
is produced when the method from_pretrained() returns the contents of the file quantize_config.json to BaseQuantizeConfig.
I was able to load the model by removing these 2 lines and the preceding comma from quantize_config.json:
"model_name_or_path": null,
"model_file_base_name": null
I suspected as much.
pip show auto-gptq
gives me: 0.2.0 dev0
But as I found the original post while searching for my error message and the one in this thread had the exact same message text (probably at the same place in the code), I thought there might be a connection.
OK, please update auto-gptq:
pip3 uninstall -y auto-gptq
git clone https://github.com/PanQiWei/AutoGPTQ
cd AutoGPTQ
pip3 install .