Instructions to use tiiuae/Falcon-H1-7B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiiuae/Falcon-H1-7B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiiuae/Falcon-H1-7B-Base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiiuae/Falcon-H1-7B-Base") model = AutoModelForCausalLM.from_pretrained("tiiuae/Falcon-H1-7B-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiiuae/Falcon-H1-7B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiiuae/Falcon-H1-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/Falcon-H1-7B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tiiuae/Falcon-H1-7B-Base
- SGLang
How to use tiiuae/Falcon-H1-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/Falcon-H1-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/Falcon-H1-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/Falcon-H1-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/Falcon-H1-7B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tiiuae/Falcon-H1-7B-Base with Docker Model Runner:
docker model run hf.co/tiiuae/Falcon-H1-7B-Base
Download config.json from tiiuae/Falcon-H1-7B-Base: direct link, hf CLI and curl.
- Browser
- Download file 1.64 kB
-
https://huggingface.co/tiiuae/Falcon-H1-7B-Base/resolve/main/config.json
- Command line
-
hf download hf://tiiuae/Falcon-H1-7B-Base/config.json
-
curl -L -o config.json https://huggingface.co/tiiuae/Falcon-H1-7B-Base/resolve/main/config.json
1.64 kB
| { | |
| "architectures": [ | |
| "FalconH1ForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "attention_in_multiplier": 1.0, | |
| "attention_out_multiplier": 0.10416666666666669, | |
| "attn_layer_indices": null, | |
| "bos_token_id": 1, | |
| "embedding_multiplier": 5.656854249492381, | |
| "eos_token_id": 11, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 3072, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 12288, | |
| "key_multiplier": 0.030690398488999456, | |
| "lm_head_multiplier": 0.013020833333333334, | |
| "mamba_chunk_size": 128, | |
| "mamba_conv_bias": true, | |
| "mamba_d_conv": 4, | |
| "mamba_d_head": 128, | |
| "mamba_d_ssm": 3072, | |
| "mamba_d_state": 256, | |
| "mamba_expand": 2, | |
| "mamba_n_groups": 1, | |
| "mamba_n_heads": 24, | |
| "mamba_norm_before_gate": false, | |
| "mamba_proj_bias": false, | |
| "mamba_rms_norm": true, | |
| "mamba_use_mlp": true, | |
| "max_position_embeddings": 262144, | |
| "mlp_bias": false, | |
| "mlp_expansion_factor": 8, | |
| "mlp_multipliers": [ | |
| 0.2946278254943948, | |
| 0.032552083333333336 | |
| ], | |
| "model_type": "falcon_h1", | |
| "num_attention_heads": 12, | |
| "num_hidden_layers": 44, | |
| "num_key_value_heads": 2, | |
| "num_logits_to_keep": 1, | |
| "pad_token_id": 0, | |
| "projectors_bias": false, | |
| "rms_norm_eps": 1e-05, | |
| "rope_scaling": null, | |
| "rope_theta": 100000000000, | |
| "ssm_in_multiplier": 0.4166666666666667, | |
| "ssm_multipliers": [ | |
| 0.3535533905932738, | |
| 0.25, | |
| 0.1767766952966369, | |
| 0.5, | |
| 0.3535533905932738 | |
| ], | |
| "ssm_out_multiplier": 0.11785113019775792, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.52.0.dev0", | |
| "use_cache": true, | |
| "vocab_size": 130048 | |
| } | |