Text Generation
Transformers
PyTorch
Core ML
Safetensors
English
falcon
conversational
custom_code
Eval Results
text-generation-inference
Instructions to use tiiuae/falcon-7b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiiuae/falcon-7b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiiuae/falcon-7b-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-7b-instruct", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("tiiuae/falcon-7b-instruct", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiiuae/falcon-7b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiiuae/falcon-7b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiiuae/falcon-7b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tiiuae/falcon-7b-instruct
- SGLang
How to use tiiuae/falcon-7b-instruct 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 "tiiuae/falcon-7b-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiiuae/falcon-7b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "tiiuae/falcon-7b-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiiuae/falcon-7b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tiiuae/falcon-7b-instruct with Docker Model Runner:
docker model run hf.co/tiiuae/falcon-7b-instruct
Commit History
-
Adding `safetensors` variant of this model (#126)
Verified signature- Adding `safetensors` variant of this model (19aa67d63b0892bf8560bdb324b5a279ef497336) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>8782b5c
-
enh: add link to new model
Verified signatureb22819d
-
add chat template to tokenizer_config.json (#111)
Verified signature- add chat template to tokenizer_config.json (16962019561b0f0c8ae490f1fb3fc4a3f8272778) Co-authored-by: Eduardo Pignatelli <epignatelli@users.noreply.huggingface.co>0b9684d
-
Move to in-libary checkpoint (for real this time) (#88)
- Move to in-libary checkpoint (8dcf514569821296b9c7422fa6ef62b8951107f9)cf4b3c4
-
Revert in-library PR (#63)
- Revert "Move to in-library checkpoint (#56)" (98bae295ee5338651de5eda81d9ad7beca524059)eb410fb
-
Move to in-library checkpoint (#56)
- Move to in-library checkpoint (e122c47dc0dff7528744de80bd2923ed28ba8553) - Preparations for transition to in-library checkpoint (9b57314e533e8de9133149bed88a5d48121d08d9) - Revert to Falcon naming (a00b46d9702c7abe4e5d25e01ea2fcca1fb8881a)f8dac3f
-
Add widget examples
c7f670a
-
Add recommendations for use
9f16e66
-
Update citation info
8281cc0 -
Add hf endpoint handler.py (#24)
- Add hf endpoint handler.py (8d5a103212eb614fc3f958ea454e6118fd5f811f) Co-authored-by: Olivier Dehaene <olivierdehaene@users.noreply.huggingface.co>7f5eb0f -
Update metadata
a1d11a0
-
Remove TII Falcon LLM license
22225c3
-
Update license information to Apache 2.0
43b757f -
Update README.md (#14)
- Update README.md (db0bccbb93f3078d04c60a115cec86dfe7959669)a8b5565
-
license: tii-falcon-llm (#11)
- license: tii-falcon-llm (08545d34822bad053b98d3c1eac7d0597c356084) Co-authored-by: Julien Chaumond <julien-c@users.noreply.huggingface.co>6677bc9 -
Update config.json
9cbb161 -
Update modelling_RW.py
93b55b6 -
coreml-weights (#8)
- Core ML weights (7d4d1a44084b77380f7c8c9ec3922a0919dafff4) Co-authored-by: Pedro Cuenca <pcuenq@users.noreply.huggingface.co>983c105
-
Add PyTorch 2.0 notice
b6efaea -
Add evaluation disclaimer
6940d5f -
Update README.md
5aad858
-
Update configuration_RW.py
Daniel Hesslow69601d5 -
Update modelling_RW.py
Daniel Hesslow8d630c5 -
Update README.md
54b3714 -
Create LICENSE.txt
7ea4d00 -
Update modelling_RW.py
Daniel Hesslowc147e5d
-
Upload tokenizer
Daniel Hesslowbacaa8a -
Update configuration_RW.py
Daniel Hesslow19299bf
-
Update README.md
Daniel Hesslowe0e1228 -
Create README.md
Daniel Hesslowe251c35
-
Upload RWForCausalLM
Daniel Hesslow06337a9 -
initial commit
7972440