Instructions to use ichitaka/falcon-40b-instruct-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ichitaka/falcon-40b-instruct-8bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ichitaka/falcon-40b-instruct-8bit", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ichitaka/falcon-40b-instruct-8bit", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ichitaka/falcon-40b-instruct-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ichitaka/falcon-40b-instruct-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ichitaka/falcon-40b-instruct-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ichitaka/falcon-40b-instruct-8bit
- SGLang
How to use ichitaka/falcon-40b-instruct-8bit 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 "ichitaka/falcon-40b-instruct-8bit" \ --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": "ichitaka/falcon-40b-instruct-8bit", "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 "ichitaka/falcon-40b-instruct-8bit" \ --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": "ichitaka/falcon-40b-instruct-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ichitaka/falcon-40b-instruct-8bit with Docker Model Runner:
docker model run hf.co/ichitaka/falcon-40b-instruct-8bit
Is the snippet in README loading the model in 8-bit mode?
Passing load_in_8bit=True fails. Does this mean the model runs in 8-bit mode without the need to pass the argument? What dtype should be?
What is the issue that you are facing?
Could you please provide a script to load this model in plain Python?
It failed to load into oobabooga/text-generation-webui for CPU inference:
RuntimeError: No GPU found. A GPU is needed for quantization.
bitsandbytes 8-Bit Quantization requires a GPU that can hold the whole model, it is not compatible with CPU inference.
the script you provided in README is loading model in full precision, do we need to pass load_in_8bit ? As of now, it downloads full checkpoints when loaded using .from_pretrained ( .... )
The weight files are only 40+ GB instead of 90+ GB for the full precision mode. I usually pass load_in_8bit when loading as well but it should be impossible to load the original weights using this repo.