Instructions to use TheBloke/stable-code-3b-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/stable-code-3b-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/stable-code-3b-GPTQ", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("TheBloke/stable-code-3b-GPTQ", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TheBloke/stable-code-3b-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheBloke/stable-code-3b-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/stable-code-3b-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TheBloke/stable-code-3b-GPTQ
- SGLang
How to use TheBloke/stable-code-3b-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/stable-code-3b-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/stable-code-3b-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/stable-code-3b-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/stable-code-3b-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TheBloke/stable-code-3b-GPTQ with Docker Model Runner:
docker model run hf.co/TheBloke/stable-code-3b-GPTQ
issue loading
10:54:10-928608 INFO Loading "TheBloke_stable-code-3b-GPTQ"
!! Warning, unknown architecture: StableLMEpochForCausalLM
!! Loading as LlamaForCausalLM
10:54:10-931120 ERROR Failed to load the model.
Traceback (most recent call last):
File "D:\ai\installs\text-generation-webui\modules\ui_model_menu.py", line 245, in load_model_wrapper
shared.model, shared.tokenizer = load_model(selected_model, loader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ai\installs\text-generation-webui\modules\models.py", line 87, in load_model
output = load_func_maploader
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ai\installs\text-generation-webui\modules\models.py", line 357, in ExLlamav2_loader
model, tokenizer = Exllamav2Model.from_pretrained(model_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ai\installs\text-generation-webui\modules\exllamav2.py", line 45, in from_pretrained
config.prepare()
File "D:\ai\installs\text-generation-webui\installer_files\env\Lib\site-packages\exllamav2\config.py", line 164, in prepare
self.norm_eps = read(read_config, float, self.arch.norm_eps_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ai\installs\text-generation-webui\installer_files\env\Lib\site-packages\exllamav2\config.py", line 41, in read
raise ValueError(f"Missing any of the following keys: {keys}")
ValueError: Missing any of the following keys: ['rms_norm_eps']
@baelof i believe only transformers(maybe auto-gptq?) supports this model currently. Use llama.cpp(still slower then exllamav2) and the gguf variant if you want faster inference then transformers