Instructions to use devanshamin/Qwen2-1.5B-Instruct-Function-Calling-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use devanshamin/Qwen2-1.5B-Instruct-Function-Calling-v1 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "devanshamin/Qwen2-1.5B-Instruct-Function-Calling-v1") - Notebooks
- Google Colab
- Kaggle
Update `chat_template` to support tools
Browse files- tokenizer_config.json +1 -1
tokenizer_config.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
| 31 |
"<|im_end|>"
|
| 32 |
],
|
| 33 |
"bos_token": null,
|
| 34 |
-
"chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{
|
| 35 |
"clean_up_tokenization_spaces": false,
|
| 36 |
"eos_token": "<|im_end|>",
|
| 37 |
"errors": "replace",
|
|
|
|
| 31 |
"<|im_end|>"
|
| 32 |
],
|
| 33 |
"bos_token": null,
|
| 34 |
+
"chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{% if tools %}<|im_start|>system\nYou are a helpful assistant with access to the following tools. Use them if required - \n```json\n{{ tools | tojson }}\n```<|im_end|>\n{% else %}<|im_start|>system\nYou are a helpful assistant.\n<|im_end|>\n{% endif %}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
| 35 |
"clean_up_tokenization_spaces": false,
|
| 36 |
"eos_token": "<|im_end|>",
|
| 37 |
"errors": "replace",
|