Instructions to use tiiuae/Falcon3-7B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiiuae/Falcon3-7B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiiuae/Falcon3-7B-Base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiiuae/Falcon3-7B-Base") model = AutoModelForCausalLM.from_pretrained("tiiuae/Falcon3-7B-Base") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use tiiuae/Falcon3-7B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiiuae/Falcon3-7B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiiuae/Falcon3-7B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tiiuae/Falcon3-7B-Base
- SGLang
How to use tiiuae/Falcon3-7B-Base 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/Falcon3-7B-Base" \ --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": "tiiuae/Falcon3-7B-Base", "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 "tiiuae/Falcon3-7B-Base" \ --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": "tiiuae/Falcon3-7B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tiiuae/Falcon3-7B-Base with Docker Model Runner:
docker model run hf.co/tiiuae/Falcon3-7B-Base
Falcon3-7B-Base
Falcon3 family of Open Foundation Models is a set of pretrained and instruct LLMs ranging from 1B to 10B.
This repository contains the Falcon3-7B-Base. It achieves state of art results (at the time of release) on reasoning, language understanding, instruction following, code and mathematics tasks. Falcon3-7B-Base supports 4 languages (english, french, spanish, portuguese) and a context length up to 32K.
β οΈ This is a raw, pretrained model, which should be further finetuned for most usecases.
Model Details
- Architecture
- transformer based causal decoder only architecture
- 28 decoder blocks
- grouped query attention (GQA) for faster inference: 12 query heads and 4 KV heads
- wider head dimension: 256
- high RoPE value to support long context understanding: 1000042
- 32k context length
- 131k vocab size
- Pretrained on 14 Teratokens of datasets comprising of web, code, STEM, high quality and mutlilingual data using 1024 H100 GPU chips
- Supports EN, FR, ES, PT
- Developed by Technology Innovation Institute
- License: TII Falcon-LLM License 2.0
- Model Release Date: December 2024
Getting started
Click to expand
import torch
from transformers import pipeline
pipe = pipeline(
"text-generation",
model="tiiuae/Falcon3-7B-Base",
torch_dtype=torch.bfloat16,
device_map="auto"
)
response = pipe("Question: How many hours in one day? Answer: ")
print(response[0]['generated_text'])
Benchmarks
We report in the following table our internal pipeline benchmarks.
- We use lm-evaluation harness.
- We report raw scores.
- We use same batch-size across all models.
| Category | Benchmark | Llama3.1-8B | Qwen2-7B | Qwen2.5-7B | gemma-2-9b | Falcon3-7B-Base |
|---|---|---|---|---|---|---|
| General | MMLU (5-shot) | 65.2 | 70.4 | 74.2 | - | 67.5 |
| MMLU-PRO (5-shot) | 32.7 | 42.1 | 43.5 | - | 39.2 | |
| IFEval | 12.0 | 30.6 | 33.9 | - | 34.3 | |
| Math | GSM8K (5-shot) | 49.4 | 77.9 | 82.9 | - | 76.2 |
| MATH(4-shot) | 4.1 | 17.5 | 15.5 | - | 18.0 | |
| Reasoning | Arc Challenge (25-shot) | 53.4 | 57.4 | 59.0 | - | 59.6 |
| GPQA (0-shot) | 31.0 | 31.9 | 33.0 | - | 35.5 | |
| MUSR (0-shot) | 38.0 | 44.1 | 44.2 | - | 47.3 | |
| BBH (3-shot) | 46.5 | 53.3 | 54.0 | - | 51.0 | |
| CommonSense Understanding | PIQA (0-shot) | 80.3 | 79.8 | 78.7 | - | 77.7 |
| SciQ (0-shot) | 96.3 | 95.9 | 96.6 | - | 95.3 | |
| Winogrande (0-shot) | 74.0 | 72.1 | 72.9 | - | 71.0 | |
| OpenbookQA (0-shot) | 33.4 | 35.2 | 33.6 | - | 31.4 |
Useful links
- View our release blogpost.
- Feel free to join our discord server if you have any questions or to interact with our researchers and developers.
Technical Report
Coming soon....
Citation
If Falcon3 family were helpful to your work, feel free to give us a cite.
@misc{Falcon3,
title = {Falcon 3 family of Open Foundation Models},
author = {TII Team},
month = {December},
year = {2024}
}
- Downloads last month
- 11,226