Upload folder using huggingface_hub
Browse files- chat_template.jinja +64 -0
- config.json +127 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +12 -0
chat_template.jinja
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token -}}
|
| 2 |
+
{%- set keep_past_thinking = keep_past_thinking | default(false) -%}
|
| 3 |
+
{%- set ns = namespace(system_prompt="") -%}
|
| 4 |
+
{%- if messages[0]["role"] == "system" -%}
|
| 5 |
+
{%- set sys_content = messages[0]["content"] -%}
|
| 6 |
+
{%- if sys_content is not string -%}
|
| 7 |
+
{%- for item in sys_content -%}
|
| 8 |
+
{%- if item["type"] == "text" -%}
|
| 9 |
+
{%- set ns.system_prompt = ns.system_prompt + item["text"] -%}
|
| 10 |
+
{%- endif -%}
|
| 11 |
+
{%- endfor -%}
|
| 12 |
+
{%- else -%}
|
| 13 |
+
{%- set ns.system_prompt = sys_content -%}
|
| 14 |
+
{%- endif -%}
|
| 15 |
+
{%- set messages = messages[1:] -%}
|
| 16 |
+
{%- endif -%}
|
| 17 |
+
{%- if tools -%}
|
| 18 |
+
{%- set ns.system_prompt = ns.system_prompt + ("\n" if ns.system_prompt else "") + "List of tools: [" -%}
|
| 19 |
+
{%- for tool in tools -%}
|
| 20 |
+
{%- if tool is not string -%}
|
| 21 |
+
{%- set tool = tool | tojson -%}
|
| 22 |
+
{%- endif -%}
|
| 23 |
+
{%- set ns.system_prompt = ns.system_prompt + tool -%}
|
| 24 |
+
{%- if not loop.last -%}
|
| 25 |
+
{%- set ns.system_prompt = ns.system_prompt + ", " -%}
|
| 26 |
+
{%- endif -%}
|
| 27 |
+
{%- endfor -%}
|
| 28 |
+
{%- set ns.system_prompt = ns.system_prompt + "]" -%}
|
| 29 |
+
{%- endif -%}
|
| 30 |
+
{%- if ns.system_prompt -%}
|
| 31 |
+
{{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
|
| 32 |
+
{%- endif -%}
|
| 33 |
+
{%- set ns.last_assistant_index = -1 -%}
|
| 34 |
+
{%- for message in messages -%}
|
| 35 |
+
{%- if message["role"] == "assistant" -%}
|
| 36 |
+
{%- set ns.last_assistant_index = loop.index0 -%}
|
| 37 |
+
{%- endif -%}
|
| 38 |
+
{%- endfor -%}
|
| 39 |
+
{%- for message in messages -%}
|
| 40 |
+
{{- "<|im_start|>" + message["role"] + "\n" -}}
|
| 41 |
+
{%- set content = message["content"] -%}
|
| 42 |
+
{%- if content is not string -%}
|
| 43 |
+
{%- set ns.content = "" -%}
|
| 44 |
+
{%- for item in content -%}
|
| 45 |
+
{%- if item["type"] == "image" -%}
|
| 46 |
+
{%- set ns.content = ns.content + "<image>" -%}
|
| 47 |
+
{%- elif item["type"] == "text" -%}
|
| 48 |
+
{%- set ns.content = ns.content + item["text"] -%}
|
| 49 |
+
{%- else -%}
|
| 50 |
+
{%- set ns.content = ns.content + item | tojson -%}
|
| 51 |
+
{%- endif -%}
|
| 52 |
+
{%- endfor -%}
|
| 53 |
+
{%- set content = ns.content -%}
|
| 54 |
+
{%- endif -%}
|
| 55 |
+
{%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
| 56 |
+
{%- if "</think>" in content -%}
|
| 57 |
+
{%- set content = content.split("</think>")[-1] | trim -%}
|
| 58 |
+
{%- endif -%}
|
| 59 |
+
{%- endif -%}
|
| 60 |
+
{{- content + "<|im_end|>\n" -}}
|
| 61 |
+
{%- endfor -%}
|
| 62 |
+
{%- if add_generation_prompt -%}
|
| 63 |
+
{{- "<|im_start|>assistant\n" -}}
|
| 64 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DatauseEncoder"
|
| 4 |
+
],
|
| 5 |
+
"auto_map": {
|
| 6 |
+
"AutoModel": "modeling_lfm2_bidirectional.Lfm2BidirectionalModel",
|
| 7 |
+
"AutoModelForMaskedLM": "modeling_lfm2_bidirectional.Lfm2BidirectionalForMaskedLM"
|
| 8 |
+
},
|
| 9 |
+
"block_auto_adjust_ff_dim": false,
|
| 10 |
+
"block_dim": 1024,
|
| 11 |
+
"block_ffn_dim_multiplier": 1.0,
|
| 12 |
+
"block_mlp_init_scale": 1.0,
|
| 13 |
+
"block_multiple_of": 256,
|
| 14 |
+
"block_norm_eps": 1e-05,
|
| 15 |
+
"block_out_init_scale": 1.0,
|
| 16 |
+
"block_use_swiglu": true,
|
| 17 |
+
"block_use_xavier_init": true,
|
| 18 |
+
"bos_token_id": 1,
|
| 19 |
+
"conv_L_cache": 3,
|
| 20 |
+
"conv_bias": false,
|
| 21 |
+
"conv_dim": 1024,
|
| 22 |
+
"conv_use_xavier_init": true,
|
| 23 |
+
"dtype": "float32",
|
| 24 |
+
"eos_token_id": 7,
|
| 25 |
+
"full_attn_idxs": null,
|
| 26 |
+
"hidden_size": 1024,
|
| 27 |
+
"id2label": {
|
| 28 |
+
"0": "Agriculture",
|
| 29 |
+
"1": "Communities and Human Settlements",
|
| 30 |
+
"2": "Conflict and Development",
|
| 31 |
+
"3": "Culture and Development",
|
| 32 |
+
"4": "Education",
|
| 33 |
+
"5": "Energy",
|
| 34 |
+
"6": "Environment",
|
| 35 |
+
"7": "Finance and Financial Sector Development",
|
| 36 |
+
"8": "Gender",
|
| 37 |
+
"9": "Governance",
|
| 38 |
+
"10": "Health",
|
| 39 |
+
"11": "Industry",
|
| 40 |
+
"12": "Informatics",
|
| 41 |
+
"13": "Information and Communication Technologies",
|
| 42 |
+
"14": "Infrastructure Economics and Finance",
|
| 43 |
+
"15": "International Economics and Trade",
|
| 44 |
+
"16": "Law and Development",
|
| 45 |
+
"17": "Macroeconomics and Economic Growth",
|
| 46 |
+
"18": "Nutrition and Population",
|
| 47 |
+
"19": "Poverty Reduction",
|
| 48 |
+
"20": "Private Sector Development",
|
| 49 |
+
"21": "Public Sector Development",
|
| 50 |
+
"22": "Rural Development",
|
| 51 |
+
"23": "Science and Technology Development",
|
| 52 |
+
"24": "Social Development",
|
| 53 |
+
"25": "Social Protections and Labor",
|
| 54 |
+
"26": "Transport",
|
| 55 |
+
"27": "Urban Development",
|
| 56 |
+
"28": "Water Resources",
|
| 57 |
+
"29": "Water Supply and Sanitation"
|
| 58 |
+
},
|
| 59 |
+
"initializer_range": 0.02,
|
| 60 |
+
"intermediate_size": 2560,
|
| 61 |
+
"label2id": {
|
| 62 |
+
"Agriculture": 0,
|
| 63 |
+
"Communities and Human Settlements": 1,
|
| 64 |
+
"Conflict and Development": 2,
|
| 65 |
+
"Culture and Development": 3,
|
| 66 |
+
"Education": 4,
|
| 67 |
+
"Energy": 5,
|
| 68 |
+
"Environment": 6,
|
| 69 |
+
"Finance and Financial Sector Development": 7,
|
| 70 |
+
"Gender": 8,
|
| 71 |
+
"Governance": 9,
|
| 72 |
+
"Health": 10,
|
| 73 |
+
"Industry": 11,
|
| 74 |
+
"Informatics": 12,
|
| 75 |
+
"Information and Communication Technologies": 13,
|
| 76 |
+
"Infrastructure Economics and Finance": 14,
|
| 77 |
+
"International Economics and Trade": 15,
|
| 78 |
+
"Law and Development": 16,
|
| 79 |
+
"Macroeconomics and Economic Growth": 17,
|
| 80 |
+
"Nutrition and Population": 18,
|
| 81 |
+
"Poverty Reduction": 19,
|
| 82 |
+
"Private Sector Development": 20,
|
| 83 |
+
"Public Sector Development": 21,
|
| 84 |
+
"Rural Development": 22,
|
| 85 |
+
"Science and Technology Development": 23,
|
| 86 |
+
"Social Development": 24,
|
| 87 |
+
"Social Protections and Labor": 25,
|
| 88 |
+
"Transport": 26,
|
| 89 |
+
"Urban Development": 27,
|
| 90 |
+
"Water Resources": 28,
|
| 91 |
+
"Water Supply and Sanitation": 29
|
| 92 |
+
},
|
| 93 |
+
"layer_types": [
|
| 94 |
+
"conv",
|
| 95 |
+
"conv",
|
| 96 |
+
"full_attention",
|
| 97 |
+
"conv",
|
| 98 |
+
"full_attention",
|
| 99 |
+
"conv",
|
| 100 |
+
"full_attention",
|
| 101 |
+
"conv",
|
| 102 |
+
"full_attention",
|
| 103 |
+
"conv",
|
| 104 |
+
"full_attention",
|
| 105 |
+
"conv",
|
| 106 |
+
"full_attention",
|
| 107 |
+
"conv"
|
| 108 |
+
],
|
| 109 |
+
"max_position_embeddings": 128000,
|
| 110 |
+
"model_type": "lfm2",
|
| 111 |
+
"norm_eps": 1e-05,
|
| 112 |
+
"num_attention_heads": 16,
|
| 113 |
+
"num_heads": 16,
|
| 114 |
+
"num_hidden_layers": 14,
|
| 115 |
+
"num_key_value_heads": 8,
|
| 116 |
+
"pad_token_id": 0,
|
| 117 |
+
"problem_type": "multi_label_classification",
|
| 118 |
+
"rope_parameters": {
|
| 119 |
+
"rope_theta": 1000000.0,
|
| 120 |
+
"rope_type": "default"
|
| 121 |
+
},
|
| 122 |
+
"tie_word_embeddings": true,
|
| 123 |
+
"transformers_version": "5.13.1",
|
| 124 |
+
"use_cache": false,
|
| 125 |
+
"use_pos_enc": true,
|
| 126 |
+
"vocab_size": 65536
|
| 127 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4cf9c6aaf42ed14dc91037daf9097fb4a3616d2c474222fcefca07a42981a959
|
| 3 |
+
size 918915196
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|startoftext|>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|im_end|>",
|
| 6 |
+
"is_local": false,
|
| 7 |
+
"local_files_only": false,
|
| 8 |
+
"mask_token": "<|mask|>",
|
| 9 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 10 |
+
"pad_token": "<|pad|>",
|
| 11 |
+
"tokenizer_class": "TokenizersBackend"
|
| 12 |
+
}
|