Instructions to use INC4AI/falcon-7b-sq-int8-inc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use INC4AI/falcon-7b-sq-int8-inc with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="INC4AI/falcon-7b-sq-int8-inc", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("INC4AI/falcon-7b-sq-int8-inc", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("INC4AI/falcon-7b-sq-int8-inc", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use INC4AI/falcon-7b-sq-int8-inc with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "INC4AI/falcon-7b-sq-int8-inc" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "INC4AI/falcon-7b-sq-int8-inc", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/INC4AI/falcon-7b-sq-int8-inc
- SGLang
How to use INC4AI/falcon-7b-sq-int8-inc 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 "INC4AI/falcon-7b-sq-int8-inc" \ --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": "INC4AI/falcon-7b-sq-int8-inc", "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 "INC4AI/falcon-7b-sq-int8-inc" \ --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": "INC4AI/falcon-7b-sq-int8-inc", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use INC4AI/falcon-7b-sq-int8-inc with Docker Model Runner:
docker model run hf.co/INC4AI/falcon-7b-sq-int8-inc
Model Details
This model is an int8 model quantized from tiiuae/falcon-7b using SmoothQuant.
Env setup
Inferece
Use IPEX 2.2
git clone https://github.com/intel/intel-extension-for-pytorch.git
cd intel-extension-for-pytorch/examples/cpu/inference/python/llm
git checkout release/2.2
python run.py --benchmark -m tiiuae/falcon-7b --ipex-smooth-quant --qconfig-summary-file <path to Intel/falcon-7b-sq-int8-inc best_configure.json"> --output-dir "saved_results"
Evaluate
Evaluate the model
git clone https://github.com/intel/intel-extension-for-pytorch.git
cd intel-extension-for-pytorch/examples/cpu/inference/python/llm/single_instance
git checkout release/2.2
python run_accuracy.py -m tiiuae/falcon-7b --quantized-model-path <path to Intel/falcon-7b-sq-int8-inc best_configure.json"> --dtype int8 --tasks lambada_openai
Results
| Metric | fp32 | int8 sq |
|---|---|---|
| Avg. | 0.6982 | 0.6992 |
| lambada_openai | 0.7467 | 0.7648 |
| hellaswag | 0.5778 | 0.5659 |
| winogrande | 0.6732 | 0.6717 |
| piqa | 0.7949 | 0.7943 |
Ethical Considerations and Limitations
The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
Therefore, before deploying any applications of the model, developers should perform safety testing.
Caveats and Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
Here are a couple of useful links to learn more about Intel's AI software:
- Downloads last month
- 23