Delete .ipynb_checkpoints
Browse files
.ipynb_checkpoints/chat_template-checkpoint.jinja
DELETED
|
@@ -1,54 +0,0 @@
|
|
| 1 |
-
{%- if tools %}
|
| 2 |
-
{{- '<|im_start|>system\n' }}
|
| 3 |
-
{%- if messages[0]['role'] == 'system' %}
|
| 4 |
-
{{- messages[0]['content'] }}
|
| 5 |
-
{%- else %}
|
| 6 |
-
{{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
|
| 7 |
-
{%- endif %}
|
| 8 |
-
{{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 9 |
-
{%- for tool in tools %}
|
| 10 |
-
{{- "\n" }}
|
| 11 |
-
{{- tool | tojson }}
|
| 12 |
-
{%- endfor %}
|
| 13 |
-
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 14 |
-
{%- else %}
|
| 15 |
-
{%- if messages[0]['role'] == 'system' %}
|
| 16 |
-
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 17 |
-
{%- else %}
|
| 18 |
-
{{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
|
| 19 |
-
{%- endif %}
|
| 20 |
-
{%- endif %}
|
| 21 |
-
{%- for message in messages %}
|
| 22 |
-
{%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
|
| 23 |
-
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 24 |
-
{%- elif message.role == "assistant" %}
|
| 25 |
-
{{- '<|im_start|>' + message.role }}
|
| 26 |
-
{%- if message.content %}
|
| 27 |
-
{{- '\n' + message.content }}
|
| 28 |
-
{%- endif %}
|
| 29 |
-
{%- for tool_call in message.tool_calls %}
|
| 30 |
-
{%- if tool_call.function is defined %}
|
| 31 |
-
{%- set tool_call = tool_call.function %}
|
| 32 |
-
{%- endif %}
|
| 33 |
-
{{- '\n<tool_call>\n{"name": "' }}
|
| 34 |
-
{{- tool_call.name }}
|
| 35 |
-
{{- '", "arguments": ' }}
|
| 36 |
-
{{- tool_call.arguments | tojson }}
|
| 37 |
-
{{- '}\n</tool_call>' }}
|
| 38 |
-
{%- endfor %}
|
| 39 |
-
{{- '<|im_end|>\n' }}
|
| 40 |
-
{%- elif message.role == "tool" %}
|
| 41 |
-
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
|
| 42 |
-
{{- '<|im_start|>user' }}
|
| 43 |
-
{%- endif %}
|
| 44 |
-
{{- '\n<tool_response>\n' }}
|
| 45 |
-
{{- message.content }}
|
| 46 |
-
{{- '\n</tool_response>' }}
|
| 47 |
-
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 48 |
-
{{- '<|im_end|>\n' }}
|
| 49 |
-
{%- endif %}
|
| 50 |
-
{%- endif %}
|
| 51 |
-
{%- endfor %}
|
| 52 |
-
{%- if add_generation_prompt %}
|
| 53 |
-
{{- '<|im_start|>assistant\n' }}
|
| 54 |
-
{%- endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.ipynb_checkpoints/config-checkpoint.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"architectures": [
|
| 3 |
-
"Qwen2ForCausalLM"
|
| 4 |
-
],
|
| 5 |
-
"attention_dropout": 0.0,
|
| 6 |
-
"bos_token_id": 151643,
|
| 7 |
-
"dtype": "float16",
|
| 8 |
-
"eos_token_id": 151645,
|
| 9 |
-
"hidden_act": "silu",
|
| 10 |
-
"hidden_size": 3584,
|
| 11 |
-
"initializer_range": 0.02,
|
| 12 |
-
"intermediate_size": 18944,
|
| 13 |
-
"layer_types": [
|
| 14 |
-
"full_attention",
|
| 15 |
-
"full_attention",
|
| 16 |
-
"full_attention",
|
| 17 |
-
"full_attention",
|
| 18 |
-
"full_attention",
|
| 19 |
-
"full_attention",
|
| 20 |
-
"full_attention",
|
| 21 |
-
"full_attention",
|
| 22 |
-
"full_attention",
|
| 23 |
-
"full_attention",
|
| 24 |
-
"full_attention",
|
| 25 |
-
"full_attention",
|
| 26 |
-
"full_attention",
|
| 27 |
-
"full_attention",
|
| 28 |
-
"full_attention",
|
| 29 |
-
"full_attention",
|
| 30 |
-
"full_attention",
|
| 31 |
-
"full_attention",
|
| 32 |
-
"full_attention",
|
| 33 |
-
"full_attention",
|
| 34 |
-
"full_attention",
|
| 35 |
-
"full_attention",
|
| 36 |
-
"full_attention",
|
| 37 |
-
"full_attention",
|
| 38 |
-
"full_attention",
|
| 39 |
-
"full_attention",
|
| 40 |
-
"full_attention",
|
| 41 |
-
"full_attention"
|
| 42 |
-
],
|
| 43 |
-
"max_position_embeddings": 32768,
|
| 44 |
-
"max_window_layers": 28,
|
| 45 |
-
"model_type": "qwen2",
|
| 46 |
-
"num_attention_heads": 28,
|
| 47 |
-
"num_hidden_layers": 28,
|
| 48 |
-
"num_key_value_heads": 4,
|
| 49 |
-
"rms_norm_eps": 1e-06,
|
| 50 |
-
"rope_scaling": null,
|
| 51 |
-
"rope_theta": 1000000.0,
|
| 52 |
-
"sliding_window": null,
|
| 53 |
-
"tie_word_embeddings": false,
|
| 54 |
-
"transformers_version": "4.57.3",
|
| 55 |
-
"use_cache": true,
|
| 56 |
-
"use_sliding_window": false,
|
| 57 |
-
"vocab_size": 152064
|
| 58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|