Instructions to use tiiuae/Falcon-H1-Tiny-R-90M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiiuae/Falcon-H1-Tiny-R-90M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiiuae/Falcon-H1-Tiny-R-90M") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiiuae/Falcon-H1-Tiny-R-90M") model = AutoModelForCausalLM.from_pretrained("tiiuae/Falcon-H1-Tiny-R-90M") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiiuae/Falcon-H1-Tiny-R-90M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiiuae/Falcon-H1-Tiny-R-90M" # 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-H1-Tiny-R-90M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tiiuae/Falcon-H1-Tiny-R-90M
- SGLang
How to use tiiuae/Falcon-H1-Tiny-R-90M 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-Tiny-R-90M" \ --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-H1-Tiny-R-90M", "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-H1-Tiny-R-90M" \ --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-H1-Tiny-R-90M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tiiuae/Falcon-H1-Tiny-R-90M with Docker Model Runner:
docker model run hf.co/tiiuae/Falcon-H1-Tiny-R-90M
Upload FalconH1ForCausalLM
Browse files- config.json +68 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
config.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"FalconH1ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"attention_in_multiplier": 1.0,
|
| 8 |
+
"attention_out_multiplier": 1.0,
|
| 9 |
+
"bos_token_id": 1,
|
| 10 |
+
"dtype": "bfloat16",
|
| 11 |
+
"embedding_multiplier": 0.034423828125,
|
| 12 |
+
"eos_token_id": 11,
|
| 13 |
+
"expansion_factor": 1.5,
|
| 14 |
+
"head_dim": 64,
|
| 15 |
+
"hidden_act": "silu",
|
| 16 |
+
"hidden_size": 512,
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
+
"intermediate_size": 768,
|
| 19 |
+
"key_multiplier": 1.0,
|
| 20 |
+
"lm_head_multiplier": 0.078125,
|
| 21 |
+
"mamba_chunk_size": 128,
|
| 22 |
+
"mamba_conv_bias": true,
|
| 23 |
+
"mamba_d_conv": 4,
|
| 24 |
+
"mamba_d_head": 32,
|
| 25 |
+
"mamba_d_ssm": 768,
|
| 26 |
+
"mamba_d_state": 64,
|
| 27 |
+
"mamba_expand": 2,
|
| 28 |
+
"mamba_n_groups": 1,
|
| 29 |
+
"mamba_n_heads": 24,
|
| 30 |
+
"mamba_norm_before_gate": false,
|
| 31 |
+
"mamba_proj_bias": false,
|
| 32 |
+
"mamba_rms_norm": false,
|
| 33 |
+
"mamba_use_mlp": true,
|
| 34 |
+
"max_position_embeddings": 262144,
|
| 35 |
+
"mlp_bias": false,
|
| 36 |
+
"mlp_multipliers": [
|
| 37 |
+
1.0,
|
| 38 |
+
1.0
|
| 39 |
+
],
|
| 40 |
+
"model_type": "falcon_h1",
|
| 41 |
+
"num_attention_heads": 8,
|
| 42 |
+
"num_hidden_layers": 24,
|
| 43 |
+
"num_key_value_heads": 2,
|
| 44 |
+
"num_logits_to_keep": 1,
|
| 45 |
+
"pad_token_id": 0,
|
| 46 |
+
"projectors_bias": false,
|
| 47 |
+
"rms_norm_eps": 1e-05,
|
| 48 |
+
"rope_scaling": null,
|
| 49 |
+
"rope_theta": 100000000000.0,
|
| 50 |
+
"sliding_window": null,
|
| 51 |
+
"ssm_in_multiplier": 1.0,
|
| 52 |
+
"ssm_multipliers": [
|
| 53 |
+
1.0,
|
| 54 |
+
1.0,
|
| 55 |
+
1.0,
|
| 56 |
+
1.0,
|
| 57 |
+
1.0
|
| 58 |
+
],
|
| 59 |
+
"ssm_out_multiplier": 1.0,
|
| 60 |
+
"tie_word_embeddings": true,
|
| 61 |
+
"time_step_floor": 0.0001,
|
| 62 |
+
"time_step_max": 0.1,
|
| 63 |
+
"time_step_min": 0.001,
|
| 64 |
+
"time_step_rank": "auto",
|
| 65 |
+
"transformers_version": "4.57.0",
|
| 66 |
+
"use_cache": true,
|
| 67 |
+
"vocab_size": 32768
|
| 68 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
11,
|
| 6 |
+
228
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 0,
|
| 9 |
+
"transformers_version": "4.57.0"
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1556cfc66e5a4b49cf1058c1fb02f3ffcfb191304bf9021066d6e0d05f473a44
|
| 3 |
+
size 182304120
|