Instructions to use LaconicAI/falcon-40b-instruct-gptq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LaconicAI/falcon-40b-instruct-gptq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LaconicAI/falcon-40b-instruct-gptq", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("LaconicAI/falcon-40b-instruct-gptq", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LaconicAI/falcon-40b-instruct-gptq with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LaconicAI/falcon-40b-instruct-gptq" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LaconicAI/falcon-40b-instruct-gptq", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LaconicAI/falcon-40b-instruct-gptq
- SGLang
How to use LaconicAI/falcon-40b-instruct-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 "LaconicAI/falcon-40b-instruct-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": "LaconicAI/falcon-40b-instruct-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 "LaconicAI/falcon-40b-instruct-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": "LaconicAI/falcon-40b-instruct-gptq", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LaconicAI/falcon-40b-instruct-gptq with Docker Model Runner:
docker model run hf.co/LaconicAI/falcon-40b-instruct-gptq
4bit GPTQ quantized version of https://huggingface.co/tiiuae/falcon-40b-instruct
Make sure to run with FlashAttention like in https://github.com/huggingface/text-generation-inference
Also note the GPTQ 4bit quantized version seems to run about 2x slower compared to the 8bit bitsandbytes version within text-generation-inference, typically we were seeing about 600-800ms latency for token generation for 8bit bitsandbytes whereas we're seeing about 1.2-1.7s with the 4bit GPTQ version.
VRAM usage is a little over 25gb for this 4bit quantized version, compared to 47gb for the 8bit and 80gb for full.
This was quantized using:
text-generation-server quantize tiiuae/falcon-40b-instruct /tmp/falcon40instructgptq --upload-to-model-id AxisMind/falcon-40b-instruct-gptq --trust-remote-code --act-order
Huggingface's GPTQ implementation can be found here: https://github.com/huggingface/text-generation-inference/blob/main/server/text_generation_server/utils/gptq/quantize.py
For testing and degradation purposes we've not yet looked at anything thoroughly, but for our usecases we did not notice any significant quality degradation which is inline with the claims of the GPTQ paper compared to other low bit quantization methods.
- Downloads last month
- 14