Instructions to use modelwizard/baboon with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modelwizard/baboon with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="modelwizard/baboon") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("modelwizard/baboon") model = AutoModelForMultimodalLM.from_pretrained("modelwizard/baboon") 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 modelwizard/baboon with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modelwizard/baboon" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modelwizard/baboon", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/modelwizard/baboon
- SGLang
How to use modelwizard/baboon 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 "modelwizard/baboon" \ --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": "modelwizard/baboon", "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 "modelwizard/baboon" \ --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": "modelwizard/baboon", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use modelwizard/baboon with Docker Model Runner:
docker model run hf.co/modelwizard/baboon
Upload tokenizer
Browse files- special_tokens_map.json +2 -2
- tokenizer.json +0 -18
- tokenizer_config.json +8 -20
special_tokens_map.json
CHANGED
|
@@ -7,14 +7,14 @@
|
|
| 7 |
"single_word": false
|
| 8 |
},
|
| 9 |
"eos_token": {
|
| 10 |
-
"content": "<
|
| 11 |
"lstrip": false,
|
| 12 |
"normalized": false,
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
"pad_token": {
|
| 17 |
-
"content": "<
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": false,
|
| 20 |
"rstrip": false,
|
|
|
|
| 7 |
"single_word": false
|
| 8 |
},
|
| 9 |
"eos_token": {
|
| 10 |
+
"content": "</s>",
|
| 11 |
"lstrip": false,
|
| 12 |
"normalized": false,
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
"pad_token": {
|
| 17 |
+
"content": "<unk>",
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": false,
|
| 20 |
"rstrip": false,
|
tokenizer.json
CHANGED
|
@@ -29,24 +29,6 @@
|
|
| 29 |
"rstrip": false,
|
| 30 |
"normalized": false,
|
| 31 |
"special": true
|
| 32 |
-
},
|
| 33 |
-
{
|
| 34 |
-
"id": 32000,
|
| 35 |
-
"content": "<|im_end|>",
|
| 36 |
-
"single_word": false,
|
| 37 |
-
"lstrip": false,
|
| 38 |
-
"rstrip": false,
|
| 39 |
-
"normalized": false,
|
| 40 |
-
"special": true
|
| 41 |
-
},
|
| 42 |
-
{
|
| 43 |
-
"id": 32001,
|
| 44 |
-
"content": "<|im_start|>",
|
| 45 |
-
"single_word": false,
|
| 46 |
-
"lstrip": false,
|
| 47 |
-
"rstrip": false,
|
| 48 |
-
"normalized": false,
|
| 49 |
-
"special": true
|
| 50 |
}
|
| 51 |
],
|
| 52 |
"normalizer": {
|
|
|
|
| 29 |
"rstrip": false,
|
| 30 |
"normalized": false,
|
| 31 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
}
|
| 33 |
],
|
| 34 |
"normalizer": {
|
tokenizer_config.json
CHANGED
|
@@ -25,37 +25,25 @@
|
|
| 25 |
"rstrip": false,
|
| 26 |
"single_word": false,
|
| 27 |
"special": true
|
| 28 |
-
},
|
| 29 |
-
"32000": {
|
| 30 |
-
"content": "<|im_end|>",
|
| 31 |
-
"lstrip": false,
|
| 32 |
-
"normalized": false,
|
| 33 |
-
"rstrip": false,
|
| 34 |
-
"single_word": false,
|
| 35 |
-
"special": true
|
| 36 |
-
},
|
| 37 |
-
"32001": {
|
| 38 |
-
"content": "<|im_start|>",
|
| 39 |
-
"lstrip": false,
|
| 40 |
-
"normalized": false,
|
| 41 |
-
"rstrip": false,
|
| 42 |
-
"single_word": false,
|
| 43 |
-
"special": true
|
| 44 |
}
|
| 45 |
},
|
| 46 |
"additional_special_tokens": [],
|
| 47 |
"bos_token": "<s>",
|
| 48 |
-
"chat_template": "{% for message in messages %}{{'
|
| 49 |
"clean_up_tokenization_spaces": false,
|
| 50 |
-
"eos_token": "<
|
| 51 |
"legacy": true,
|
|
|
|
| 52 |
"model_max_length": 1000000000000000019884624838656,
|
| 53 |
-
"pad_token": "<
|
| 54 |
"sp_model_kwargs": {},
|
| 55 |
"spaces_between_special_tokens": false,
|
|
|
|
| 56 |
"tokenizer_class": "LlamaTokenizer",
|
|
|
|
|
|
|
| 57 |
"trust_remote_code": false,
|
| 58 |
"unk_token": "<unk>",
|
| 59 |
-
"use_default_system_prompt":
|
| 60 |
"use_fast": true
|
| 61 |
}
|
|
|
|
| 25 |
"rstrip": false,
|
| 26 |
"single_word": false,
|
| 27 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
},
|
| 30 |
"additional_special_tokens": [],
|
| 31 |
"bos_token": "<s>",
|
| 32 |
+
"chat_template": "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token + ' ' }}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}",
|
| 33 |
"clean_up_tokenization_spaces": false,
|
| 34 |
+
"eos_token": "</s>",
|
| 35 |
"legacy": true,
|
| 36 |
+
"max_length": 2048,
|
| 37 |
"model_max_length": 1000000000000000019884624838656,
|
| 38 |
+
"pad_token": "<unk>",
|
| 39 |
"sp_model_kwargs": {},
|
| 40 |
"spaces_between_special_tokens": false,
|
| 41 |
+
"stride": 0,
|
| 42 |
"tokenizer_class": "LlamaTokenizer",
|
| 43 |
+
"truncation_side": "right",
|
| 44 |
+
"truncation_strategy": "longest_first",
|
| 45 |
"trust_remote_code": false,
|
| 46 |
"unk_token": "<unk>",
|
| 47 |
+
"use_default_system_prompt": false,
|
| 48 |
"use_fast": true
|
| 49 |
}
|