Instructions to use bn22/CLIPlike-ViT-B-32-Qwen3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bn22/CLIPlike-ViT-B-32-Qwen3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="bn22/CLIPlike-ViT-B-32-Qwen3")# Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("bn22/CLIPlike-ViT-B-32-Qwen3") model = AutoModel.from_pretrained("bn22/CLIPlike-ViT-B-32-Qwen3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload processor
Browse files- chat_template.jinja +8 -12
- tokenizer.json +2 -2
- tokenizer_config.json +1 -0
chat_template.jinja
CHANGED
|
@@ -17,27 +17,23 @@
|
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
{%- for message in messages[::-1] %}
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
-
{%- if ns.multi_step_tool and message.role == "user" and
|
| 21 |
{%- set ns.multi_step_tool = false %}
|
| 22 |
{%- set ns.last_query_index = index %}
|
| 23 |
{%- endif %}
|
| 24 |
{%- endfor %}
|
| 25 |
{%- for message in messages %}
|
| 26 |
-
{%- if message.content is string %}
|
| 27 |
-
{%- set content = message.content %}
|
| 28 |
-
{%- else %}
|
| 29 |
-
{%- set content = '' %}
|
| 30 |
-
{%- endif %}
|
| 31 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
-
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 33 |
{%- elif message.role == "assistant" %}
|
|
|
|
| 34 |
{%- set reasoning_content = '' %}
|
| 35 |
-
{%- if message.reasoning_content is
|
| 36 |
{%- set reasoning_content = message.reasoning_content %}
|
| 37 |
{%- else %}
|
| 38 |
-
{%- if '</think>' in content %}
|
| 39 |
-
{%- set
|
| 40 |
-
{%- set
|
| 41 |
{%- endif %}
|
| 42 |
{%- endif %}
|
| 43 |
{%- if loop.index0 > ns.last_query_index %}
|
|
@@ -74,7 +70,7 @@
|
|
| 74 |
{{- '<|im_start|>user' }}
|
| 75 |
{%- endif %}
|
| 76 |
{{- '\n<tool_response>\n' }}
|
| 77 |
-
{{- content }}
|
| 78 |
{{- '\n</tool_response>' }}
|
| 79 |
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 80 |
{{- '<|im_end|>\n' }}
|
|
|
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
{%- for message in messages[::-1] %}
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- if ns.multi_step_tool and message.role == "user" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 21 |
{%- set ns.multi_step_tool = false %}
|
| 22 |
{%- set ns.last_query_index = index %}
|
| 23 |
{%- endif %}
|
| 24 |
{%- endfor %}
|
| 25 |
{%- for message in messages %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 27 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 28 |
{%- elif message.role == "assistant" %}
|
| 29 |
+
{%- set content = message.content %}
|
| 30 |
{%- set reasoning_content = '' %}
|
| 31 |
+
{%- if message.reasoning_content is defined and message.reasoning_content is not none %}
|
| 32 |
{%- set reasoning_content = message.reasoning_content %}
|
| 33 |
{%- else %}
|
| 34 |
+
{%- if '</think>' in message.content %}
|
| 35 |
+
{%- set content = message.content.split('</think>')[-1].lstrip('\n') %}
|
| 36 |
+
{%- set reasoning_content = message.content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 37 |
{%- endif %}
|
| 38 |
{%- endif %}
|
| 39 |
{%- if loop.index0 > ns.last_query_index %}
|
|
|
|
| 70 |
{{- '<|im_start|>user' }}
|
| 71 |
{%- endif %}
|
| 72 |
{{- '\n<tool_response>\n' }}
|
| 73 |
+
{{- message.content }}
|
| 74 |
{{- '\n</tool_response>' }}
|
| 75 |
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 76 |
{{- '<|im_end|>\n' }}
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:93623af029cdc69b87f2864d3b2cc2424fdf16684f15e139b5b9d08ec34ced91
|
| 3 |
+
size 11423701
|
tokenizer_config.json
CHANGED
|
@@ -22,6 +22,7 @@
|
|
| 22 |
],
|
| 23 |
"is_local": false,
|
| 24 |
"model_max_length": 128,
|
|
|
|
| 25 |
"pad_token": "<|endoftext|>",
|
| 26 |
"processor_class": "VisionTextDualEncoderProcessor",
|
| 27 |
"split_special_tokens": false,
|
|
|
|
| 22 |
],
|
| 23 |
"is_local": false,
|
| 24 |
"model_max_length": 128,
|
| 25 |
+
"model_specific_special_tokens": {},
|
| 26 |
"pad_token": "<|endoftext|>",
|
| 27 |
"processor_class": "VisionTextDualEncoderProcessor",
|
| 28 |
"split_special_tokens": false,
|