Instructions to use trl-internal-testing/tiny-FalconMambaForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-FalconMambaForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="trl-internal-testing/tiny-FalconMambaForCausalLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("trl-internal-testing/tiny-FalconMambaForCausalLM") model = AutoModelForCausalLM.from_pretrained("trl-internal-testing/tiny-FalconMambaForCausalLM", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use trl-internal-testing/tiny-FalconMambaForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trl-internal-testing/tiny-FalconMambaForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-FalconMambaForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trl-internal-testing/tiny-FalconMambaForCausalLM
- SGLang
How to use trl-internal-testing/tiny-FalconMambaForCausalLM 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 "trl-internal-testing/tiny-FalconMambaForCausalLM" \ --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": "trl-internal-testing/tiny-FalconMambaForCausalLM", "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 "trl-internal-testing/tiny-FalconMambaForCausalLM" \ --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": "trl-internal-testing/tiny-FalconMambaForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use trl-internal-testing/tiny-FalconMambaForCausalLM with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-FalconMambaForCausalLM
Upload FalconMambaForCausalLM
#1
by albertvillanova HF Staff - opened
- chat_template.jinja +4 -17
- config.json +1 -1
- generation_config.json +7 -3
- model.safetensors +1 -1
- special_tokens_map.json +19 -5
- tokenizer.json +18 -11
- tokenizer_config.json +18 -12
chat_template.jinja
CHANGED
|
@@ -1,17 +1,4 @@
|
|
| 1 |
-
{
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
'
|
| 5 |
-
').replace('
|
| 6 |
-
|
| 7 |
-
', '
|
| 8 |
-
') }}{% elif message['role'] == 'assistant' %}{{ '
|
| 9 |
-
|
| 10 |
-
Assistant: ' + message['content'].strip().replace('
|
| 11 |
-
', '
|
| 12 |
-
').replace('
|
| 13 |
-
|
| 14 |
-
', '
|
| 15 |
-
') }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '
|
| 16 |
-
|
| 17 |
-
Assistant:' }}{% endif %}
|
|
|
|
| 1 |
+
{{bos_token}}{% for message in messages %}{{'<|im_start|>' + message['role'] + '
|
| 2 |
+
' + message['content'] + '<|im_end|>' + '
|
| 3 |
+
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
| 4 |
+
' }}{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
| 27 |
"time_step_min": 0.001,
|
| 28 |
"time_step_rank": 1,
|
| 29 |
"time_step_scale": 1.0,
|
| 30 |
-
"transformers_version": "4.
|
| 31 |
"use_bias": false,
|
| 32 |
"use_cache": true,
|
| 33 |
"use_conv_bias": true,
|
|
|
|
| 27 |
"time_step_min": 0.001,
|
| 28 |
"time_step_rank": 1,
|
| 29 |
"time_step_scale": 1.0,
|
| 30 |
+
"transformers_version": "4.56.2",
|
| 31 |
"use_bias": false,
|
| 32 |
"use_cache": true,
|
| 33 |
"use_conv_bias": true,
|
generation_config.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
-
"bos_token_id":
|
| 4 |
-
"eos_token_id":
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 8,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
11,
|
| 6 |
+
10
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 0,
|
| 9 |
+
"transformers_version": "4.56.2"
|
| 10 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1053056
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:058b95590b4d09739a25ffa74f2b4728ce7b4f2b6e108903751774a26ebc88e9
|
| 3 |
size 1053056
|
special_tokens_map.json
CHANGED
|
@@ -7,13 +7,27 @@
|
|
| 7 |
">>COMMENT<<",
|
| 8 |
">>ANSWER<<",
|
| 9 |
">>QUESTION<<",
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
"eos_token": {
|
| 16 |
-
"content": "<|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"lstrip": false,
|
| 18 |
"normalized": false,
|
| 19 |
"rstrip": false,
|
|
|
|
| 7 |
">>COMMENT<<",
|
| 8 |
">>ANSWER<<",
|
| 9 |
">>QUESTION<<",
|
| 10 |
+
"assistant",
|
| 11 |
+
"<|begin_of_text|>",
|
| 12 |
+
"<|im_start|>",
|
| 13 |
+
"<|im_end|>"
|
| 14 |
],
|
| 15 |
+
"bos_token": {
|
| 16 |
+
"content": "<|begin_of_text|>",
|
| 17 |
+
"lstrip": false,
|
| 18 |
+
"normalized": false,
|
| 19 |
+
"rstrip": false,
|
| 20 |
+
"single_word": false
|
| 21 |
+
},
|
| 22 |
"eos_token": {
|
| 23 |
+
"content": "<|end_of_text|>",
|
| 24 |
+
"lstrip": false,
|
| 25 |
+
"normalized": false,
|
| 26 |
+
"rstrip": false,
|
| 27 |
+
"single_word": false
|
| 28 |
+
},
|
| 29 |
+
"pad_token": {
|
| 30 |
+
"content": ">>TITLE<<",
|
| 31 |
"lstrip": false,
|
| 32 |
"normalized": false,
|
| 33 |
"rstrip": false,
|
tokenizer.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
"truncation": null,
|
| 4 |
-
"padding":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
"added_tokens": [
|
| 6 |
{
|
| 7 |
"id": 0,
|
|
@@ -68,7 +75,7 @@
|
|
| 68 |
},
|
| 69 |
{
|
| 70 |
"id": 7,
|
| 71 |
-
"content": "
|
| 72 |
"single_word": false,
|
| 73 |
"lstrip": false,
|
| 74 |
"rstrip": false,
|
|
@@ -77,7 +84,7 @@
|
|
| 77 |
},
|
| 78 |
{
|
| 79 |
"id": 8,
|
| 80 |
-
"content": "
|
| 81 |
"single_word": false,
|
| 82 |
"lstrip": false,
|
| 83 |
"rstrip": false,
|
|
@@ -86,7 +93,7 @@
|
|
| 86 |
},
|
| 87 |
{
|
| 88 |
"id": 9,
|
| 89 |
-
"content": "
|
| 90 |
"single_word": false,
|
| 91 |
"lstrip": false,
|
| 92 |
"rstrip": false,
|
|
@@ -95,7 +102,7 @@
|
|
| 95 |
},
|
| 96 |
{
|
| 97 |
"id": 10,
|
| 98 |
-
"content": "
|
| 99 |
"single_word": false,
|
| 100 |
"lstrip": false,
|
| 101 |
"rstrip": false,
|
|
@@ -104,7 +111,7 @@
|
|
| 104 |
},
|
| 105 |
{
|
| 106 |
"id": 11,
|
| 107 |
-
"content": "<|
|
| 108 |
"single_word": false,
|
| 109 |
"lstrip": false,
|
| 110 |
"rstrip": false,
|
|
@@ -164,11 +171,11 @@
|
|
| 164 |
">>COMMENT<<": 4,
|
| 165 |
">>ANSWER<<": 5,
|
| 166 |
">>QUESTION<<": 6,
|
| 167 |
-
"
|
| 168 |
-
"
|
| 169 |
-
"
|
| 170 |
-
"
|
| 171 |
-
"<|
|
| 172 |
"!": 12,
|
| 173 |
"\"": 13,
|
| 174 |
"#": 14,
|
|
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
"truncation": null,
|
| 4 |
+
"padding": {
|
| 5 |
+
"strategy": "BatchLongest",
|
| 6 |
+
"direction": "Left",
|
| 7 |
+
"pad_to_multiple_of": null,
|
| 8 |
+
"pad_id": 11,
|
| 9 |
+
"pad_type_id": 0,
|
| 10 |
+
"pad_token": "<|end_of_text|>"
|
| 11 |
+
},
|
| 12 |
"added_tokens": [
|
| 13 |
{
|
| 14 |
"id": 0,
|
|
|
|
| 75 |
},
|
| 76 |
{
|
| 77 |
"id": 7,
|
| 78 |
+
"content": "assistant",
|
| 79 |
"single_word": false,
|
| 80 |
"lstrip": false,
|
| 81 |
"rstrip": false,
|
|
|
|
| 84 |
},
|
| 85 |
{
|
| 86 |
"id": 8,
|
| 87 |
+
"content": "<|begin_of_text|>",
|
| 88 |
"single_word": false,
|
| 89 |
"lstrip": false,
|
| 90 |
"rstrip": false,
|
|
|
|
| 93 |
},
|
| 94 |
{
|
| 95 |
"id": 9,
|
| 96 |
+
"content": "<|im_start|>",
|
| 97 |
"single_word": false,
|
| 98 |
"lstrip": false,
|
| 99 |
"rstrip": false,
|
|
|
|
| 102 |
},
|
| 103 |
{
|
| 104 |
"id": 10,
|
| 105 |
+
"content": "<|im_end|>",
|
| 106 |
"single_word": false,
|
| 107 |
"lstrip": false,
|
| 108 |
"rstrip": false,
|
|
|
|
| 111 |
},
|
| 112 |
{
|
| 113 |
"id": 11,
|
| 114 |
+
"content": "<|end_of_text|>",
|
| 115 |
"single_word": false,
|
| 116 |
"lstrip": false,
|
| 117 |
"rstrip": false,
|
|
|
|
| 171 |
">>COMMENT<<": 4,
|
| 172 |
">>ANSWER<<": 5,
|
| 173 |
">>QUESTION<<": 6,
|
| 174 |
+
"assistant": 7,
|
| 175 |
+
"<|begin_of_text|>": 8,
|
| 176 |
+
"<|im_start|>": 9,
|
| 177 |
+
"<|im_end|>": 10,
|
| 178 |
+
"<|end_of_text|>": 11,
|
| 179 |
"!": 12,
|
| 180 |
"\"": 13,
|
| 181 |
"#": 14,
|
tokenizer_config.json
CHANGED
|
@@ -58,7 +58,7 @@
|
|
| 58 |
"special": true
|
| 59 |
},
|
| 60 |
"7": {
|
| 61 |
-
"content": "
|
| 62 |
"lstrip": false,
|
| 63 |
"normalized": false,
|
| 64 |
"rstrip": false,
|
|
@@ -66,7 +66,7 @@
|
|
| 66 |
"special": true
|
| 67 |
},
|
| 68 |
"8": {
|
| 69 |
-
"content": "
|
| 70 |
"lstrip": false,
|
| 71 |
"normalized": false,
|
| 72 |
"rstrip": false,
|
|
@@ -74,7 +74,7 @@
|
|
| 74 |
"special": true
|
| 75 |
},
|
| 76 |
"9": {
|
| 77 |
-
"content": "
|
| 78 |
"lstrip": false,
|
| 79 |
"normalized": false,
|
| 80 |
"rstrip": false,
|
|
@@ -82,7 +82,7 @@
|
|
| 82 |
"special": true
|
| 83 |
},
|
| 84 |
"10": {
|
| 85 |
-
"content": "
|
| 86 |
"lstrip": false,
|
| 87 |
"normalized": false,
|
| 88 |
"rstrip": false,
|
|
@@ -90,7 +90,7 @@
|
|
| 90 |
"special": true
|
| 91 |
},
|
| 92 |
"11": {
|
| 93 |
-
"content": "<|
|
| 94 |
"lstrip": false,
|
| 95 |
"normalized": false,
|
| 96 |
"rstrip": false,
|
|
@@ -106,18 +106,24 @@
|
|
| 106 |
">>COMMENT<<",
|
| 107 |
">>ANSWER<<",
|
| 108 |
">>QUESTION<<",
|
| 109 |
-
"
|
| 110 |
-
"
|
| 111 |
-
"
|
| 112 |
-
"
|
| 113 |
],
|
| 114 |
-
"
|
| 115 |
-
"
|
|
|
|
| 116 |
"extra_special_tokens": {},
|
|
|
|
| 117 |
"model_input_names": [
|
| 118 |
"input_ids",
|
| 119 |
"attention_mask"
|
| 120 |
],
|
| 121 |
-
"model_max_length":
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
"tokenizer_class": "PreTrainedTokenizerFast"
|
| 123 |
}
|
|
|
|
| 58 |
"special": true
|
| 59 |
},
|
| 60 |
"7": {
|
| 61 |
+
"content": "assistant",
|
| 62 |
"lstrip": false,
|
| 63 |
"normalized": false,
|
| 64 |
"rstrip": false,
|
|
|
|
| 66 |
"special": true
|
| 67 |
},
|
| 68 |
"8": {
|
| 69 |
+
"content": "<|begin_of_text|>",
|
| 70 |
"lstrip": false,
|
| 71 |
"normalized": false,
|
| 72 |
"rstrip": false,
|
|
|
|
| 74 |
"special": true
|
| 75 |
},
|
| 76 |
"9": {
|
| 77 |
+
"content": "<|im_start|>",
|
| 78 |
"lstrip": false,
|
| 79 |
"normalized": false,
|
| 80 |
"rstrip": false,
|
|
|
|
| 82 |
"special": true
|
| 83 |
},
|
| 84 |
"10": {
|
| 85 |
+
"content": "<|im_end|>",
|
| 86 |
"lstrip": false,
|
| 87 |
"normalized": false,
|
| 88 |
"rstrip": false,
|
|
|
|
| 90 |
"special": true
|
| 91 |
},
|
| 92 |
"11": {
|
| 93 |
+
"content": "<|end_of_text|>",
|
| 94 |
"lstrip": false,
|
| 95 |
"normalized": false,
|
| 96 |
"rstrip": false,
|
|
|
|
| 106 |
">>COMMENT<<",
|
| 107 |
">>ANSWER<<",
|
| 108 |
">>QUESTION<<",
|
| 109 |
+
"assistant",
|
| 110 |
+
"<|begin_of_text|>",
|
| 111 |
+
"<|im_start|>",
|
| 112 |
+
"<|im_end|>"
|
| 113 |
],
|
| 114 |
+
"bos_token": "<|begin_of_text|>",
|
| 115 |
+
"clean_up_tokenization_spaces": true,
|
| 116 |
+
"eos_token": "<|end_of_text|>",
|
| 117 |
"extra_special_tokens": {},
|
| 118 |
+
"max_length": null,
|
| 119 |
"model_input_names": [
|
| 120 |
"input_ids",
|
| 121 |
"attention_mask"
|
| 122 |
],
|
| 123 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 124 |
+
"pad_to_multiple_of": null,
|
| 125 |
+
"pad_token": ">>TITLE<<",
|
| 126 |
+
"pad_token_type_id": 0,
|
| 127 |
+
"padding_side": "left",
|
| 128 |
"tokenizer_class": "PreTrainedTokenizerFast"
|
| 129 |
}
|