初始化项目,由ModelHub XC社区提供模型
Model: rita-cohere/tya-m1-temp06-user Source: Original Platform
This commit is contained in:
50
.gitattributes
vendored
Normal file
50
.gitattributes
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/certifi-2026.6.17-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/charset_normalizer-3.4.9-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/fsspec-2026.6.0-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/hf_xet-1.5.1-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/huggingface_hub-0.36.2-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/numpy-2.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/packaging-26.2-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/pyyaml-6.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/regex-2026.6.28-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/safetensors-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/tqdm-4.68.4-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/transformers-4.56.2-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
|
||||
wheels/urllib3-2.7.0-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
|
||||
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||
19
README.md
Normal file
19
README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
language:
|
||||
- multilingual
|
||||
base_model: CohereLabs/tiny-aya
|
||||
tags:
|
||||
- iol-ai
|
||||
- linguistics
|
||||
- reasoning
|
||||
- multilingual
|
||||
---
|
||||
|
||||
# tya-m1-multilingual
|
||||
|
||||
Mehrnaz Tiny Aya **M1** — **multilingual** SFT (`44` langs / `ckpt-61138` `hf_export/bf16`), packaged for IOL-AI 2026.
|
||||
|
||||
Not an English-only / English-thinking checkpoint (that is A1: `rita-cohere/tya-eng-v1`).
|
||||
|
||||
`script.py`: think budget **1536**, answer continuation **512**, force-close `<|END_THINKING|>`, parser v2, format-focused system prompt.
|
||||
0
_HF_EXPORT_IS_COMPLETE
Normal file
0
_HF_EXPORT_IS_COMPLETE
Normal file
77
chat_template.jinja
Normal file
77
chat_template.jinja
Normal file
@@ -0,0 +1,77 @@
|
||||
{%- set skip_preamble = skip_preamble | default(false) -%}
|
||||
{%- set skip_thinking = skip_thinking | default(false) -%}
|
||||
{{- bos_token -}}
|
||||
{%- if skip_preamble -%}
|
||||
{%- if preamble -%}
|
||||
{{- "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>" -}}
|
||||
{{- preamble -}}
|
||||
{{- "<|END_OF_TURN_TOKEN|>" -}}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{{- "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\n" -}}
|
||||
{{- "You are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n" -}}
|
||||
{{- "Your information cutoff date is June 2024.\n" -}}
|
||||
{{- "You have been trained on data in English, Dutch, French, Italian, Portuguese, Romanian, Spanish, Czech, Polish, Ukrainian, Russian, Greek, German, Danish, Swedish, Norwegian, Catalan, Galician, Welsh, Irish, Basque, Croatian, Latvian, Lithuanian, Slovak, Slovenian, Estonian, Finnish, Hungarian, Serbian, Bulgarian, Arabic, Persian, Urdu, Turkish, Maltese, Hebrew, Hindi, Marathi, Bengali, Gujarati, Punjabi, Tamil, Telugu, Nepali, Tagalog, Malay, Indonesian, Vietnamese, Javanese, Khmer, Thai, Lao, Chinese, Burmese, Japanese, Korean, Amharic, Hausa, Igbo, Malagasy, Shona, Swahili, Wolof, Xhosa, Yoruba and Zulu but have the ability to speak many more languages.\n" -}}
|
||||
{{- "# Default Preamble\n" -}}
|
||||
{{- "The following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n" -}}
|
||||
{{- "- Your name is Aya.\n" -}}
|
||||
{{- "- You are a large language model built by Cohere.\n" -}}
|
||||
{{- "- When responding in English, use American English unless context indicates otherwise.\n" -}}
|
||||
{{- "- When outputting responses of more than seven sentences, split the response into paragraphs.\n" -}}
|
||||
{{- "- Prefer the active voice.\n" -}}
|
||||
{{- "- Use gender-neutral pronouns for unspecified persons.\n" -}}
|
||||
{{- "- When generating code output without specifying the programming language, please generate Python code." -}}
|
||||
{%- if preamble is defined and preamble -%}
|
||||
{{- "\n# Developer Preamble\n" -}}
|
||||
{{- "The following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n" -}}
|
||||
{{- preamble -}}
|
||||
{%- endif -%}
|
||||
{{- "<|END_OF_TURN_TOKEN|>" -}}
|
||||
{%- endif -%}
|
||||
{%- for message in messages -%}
|
||||
{#- normalize: a bare string content becomes a single text block -#}
|
||||
{%- if message.content is string -%}
|
||||
{%- set content = [{"type": "text", "data": message.content}] -%}
|
||||
{%- else -%}
|
||||
{%- set content = message.content -%}
|
||||
{%- endif -%}
|
||||
{{- "<|START_OF_TURN_TOKEN|>" -}}
|
||||
{%- set msg_role_downcased = message.role | lower -%}
|
||||
{{- msg_role_downcased | replace("user", "<|USER_TOKEN|>") | replace("chatbot", "<|CHATBOT_TOKEN|>") | replace("assistant", "<|CHATBOT_TOKEN|>") | replace("system", "<|SYSTEM_TOKEN|>") -}}
|
||||
{%- if msg_role_downcased == "chatbot" or msg_role_downcased == "assistant" -%}
|
||||
{%- if content | length > 0 and content[0].type == "thinking" and not skip_thinking -%}
|
||||
{{- "<|START_THINKING|>" -}}
|
||||
{{- content[0].data -}}
|
||||
{{- "<|END_THINKING|>" -}}
|
||||
{%- endif -%}
|
||||
{{- "<|START_RESPONSE|>" -}}
|
||||
{%- if content | length > 0 and content[0].type == "text" -%}
|
||||
{{- content[0].data -}}
|
||||
{%- elif content | length > 1 and content[1].type == "text" -%}
|
||||
{{- content[1].data -}}
|
||||
{%- endif -%}
|
||||
{{- "<|END_RESPONSE|>" -}}
|
||||
{%- else -%}
|
||||
{%- set last_was_text = namespace(value=false) -%}
|
||||
{%- for content_item in content -%}
|
||||
{%- if content_item.type == "text" -%}
|
||||
{%- if last_was_text.value -%}
|
||||
{{- "\n" -}}
|
||||
{%- endif -%}
|
||||
{{- content_item.data -}}
|
||||
{%- set last_was_text.value = true -%}
|
||||
{%- else -%}
|
||||
{{- content_item.data -}}
|
||||
{%- set last_was_text.value = false -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{{- "<|END_OF_TURN_TOKEN|>" -}}
|
||||
{%- endfor -%}
|
||||
{{- "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" -}}
|
||||
{%- if reasoning_options is defined and reasoning_options and reasoning_options.enabled -%}
|
||||
{{- "<|START_THINKING|>" -}}
|
||||
{%- else -%}
|
||||
{{- "<|START_THINKING|><|END_THINKING|>" -}}
|
||||
{%- endif -%}
|
||||
|
||||
80
config.json
Normal file
80
config.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"_sliding_window_pattern": 4,
|
||||
"architectures": [
|
||||
"Cohere2ForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 2,
|
||||
"dtype": "bfloat16",
|
||||
"eos_token_id": 3,
|
||||
"head_dim": 128,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 2048,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 11008,
|
||||
"layer_norm_eps": 1e-05,
|
||||
"layer_switch": 4,
|
||||
"layer_types": [
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention"
|
||||
],
|
||||
"logit_scale": 1.0,
|
||||
"max_position_embeddings": 5000000,
|
||||
"model_type": "cohere2",
|
||||
"norm_type": "layer_norm",
|
||||
"num_attention_heads": 16,
|
||||
"num_hidden_layers": 36,
|
||||
"num_key_value_heads": 4,
|
||||
"order_of_interleaved_layers": "local_attn_first",
|
||||
"pad_token_id": 0,
|
||||
"position_embedding_type": "rope_gptj",
|
||||
"rms_norm_eps": null,
|
||||
"rope_scaling": null,
|
||||
"rope_style": "interleave",
|
||||
"rope_theta": 50000,
|
||||
"rotary_pct": 1.0,
|
||||
"sliding_window": 4096,
|
||||
"transformer_block_type": "parallel",
|
||||
"transformers_version": "4.56.2.4",
|
||||
"use_cache": true,
|
||||
"use_embedding_sharing": true,
|
||||
"use_gated_activation": true,
|
||||
"use_parallel_embedding": false,
|
||||
"use_qk_norm": false,
|
||||
"vocab_size": 262144
|
||||
}
|
||||
7
generation_config.json
Normal file
7
generation_config.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 2,
|
||||
"eos_token_id": 3,
|
||||
"pad_token_id": 0,
|
||||
"transformers_version": "4.56.2.4"
|
||||
}
|
||||
478
model.safetensors.index.json
Normal file
478
model.safetensors.index.json
Normal file
@@ -0,0 +1,478 @@
|
||||
{
|
||||
"weight_map": {
|
||||
"model.embed_tokens.weight": "worker-000-000.safetensors",
|
||||
"model.layers.0.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.0.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.1.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.1.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.2.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.2.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.3.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.3.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.4.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.4.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.5.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.5.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.6.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.6.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.7.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.7.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.8.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.8.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.9.mlp.up_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.9.mlp.gate_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.0.self_attn.q_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.0.self_attn.o_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.0.self_attn.k_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.0.self_attn.v_proj.weight": "worker-000-000.safetensors",
|
||||
"model.layers.0.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.0.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.1.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.1.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.2.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.2.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.3.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.3.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.4.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.4.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.5.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.5.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.6.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.6.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.7.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.7.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.8.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.8.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.9.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.9.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.10.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.10.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.11.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.11.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.12.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.12.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.13.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.13.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.14.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.14.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.15.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.15.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.16.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.16.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.17.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.17.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.18.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.18.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.19.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.19.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.20.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.20.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.21.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.21.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.22.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.22.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.23.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.23.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.24.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.24.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.25.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.25.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.26.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.26.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.27.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.27.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.28.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.28.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.29.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.29.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.30.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.30.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.31.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.31.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.32.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.32.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.33.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.33.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.34.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.34.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.35.mlp.up_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.35.mlp.gate_proj.bias": "worker-000-000.safetensors",
|
||||
"model.norm.weight": "worker-000-000.safetensors",
|
||||
"model.norm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.0.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.0.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.0.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.0.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.1.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.1.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.1.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.1.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.2.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.2.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.2.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.2.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.3.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.3.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.3.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.3.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.4.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.4.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.4.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.4.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.5.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.5.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.5.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.5.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.6.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.6.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.6.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.6.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.7.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.7.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.7.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.7.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.8.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.8.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.8.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.8.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.9.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.9.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.9.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.9.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.10.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.10.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.10.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.10.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.11.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.11.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.11.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.11.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.12.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.12.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.12.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.12.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.13.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.13.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.13.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.13.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.14.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.14.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.14.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.14.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.15.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.15.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.15.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.15.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.16.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.16.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.16.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.16.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.17.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.17.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.17.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.17.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.18.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.18.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.18.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.18.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.19.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.19.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.19.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.19.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.20.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.20.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.20.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.20.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.21.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.21.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.21.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.21.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.22.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.22.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.22.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.22.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.23.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.23.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.23.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.23.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.24.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.24.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.24.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.24.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.25.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.25.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.25.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.25.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.26.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.26.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.26.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.26.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.27.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.27.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.27.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.27.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.28.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.28.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.28.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.28.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.29.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.29.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.29.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.29.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.30.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.30.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.30.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.30.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.31.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.31.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.31.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.31.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.32.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.32.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.32.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.32.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.33.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.33.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.33.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.33.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.34.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.34.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.34.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.34.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.35.input_layernorm.weight": "worker-000-000.safetensors",
|
||||
"model.layers.35.input_layernorm.bias": "worker-000-000.safetensors",
|
||||
"model.layers.35.self_attn.o_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.35.mlp.down_proj.bias": "worker-000-000.safetensors",
|
||||
"model.layers.10.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.10.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.11.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.11.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.12.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.12.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.13.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.13.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.14.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.14.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.15.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.15.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.16.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.16.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.17.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.17.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.18.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.18.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.19.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.19.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.20.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.20.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.21.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.21.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.22.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.22.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.23.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.23.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.24.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.24.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.25.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.25.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.26.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.26.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.27.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.27.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.28.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.28.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.29.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.29.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.30.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.30.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.31.mlp.up_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.31.mlp.gate_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.1.self_attn.q_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.1.self_attn.k_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.1.self_attn.v_proj.weight": "worker-000-001.safetensors",
|
||||
"model.layers.32.mlp.up_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.32.mlp.gate_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.33.mlp.up_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.33.mlp.gate_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.34.mlp.up_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.34.mlp.gate_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.35.mlp.up_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.35.mlp.gate_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.0.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.1.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.2.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.3.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.4.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.5.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.6.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.7.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.8.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.9.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.10.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.11.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.12.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.13.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.14.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.15.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.16.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.17.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.18.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.19.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.20.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.21.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.22.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.23.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.24.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.25.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.26.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.27.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.28.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.29.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.30.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.31.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.32.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.33.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.34.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.35.mlp.down_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.1.self_attn.o_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.2.self_attn.k_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.2.self_attn.v_proj.weight": "worker-000-002.safetensors",
|
||||
"model.layers.2.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.2.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.3.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.3.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.4.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.4.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.5.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.5.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.6.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.6.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.7.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.7.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.8.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.8.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.9.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.9.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.10.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.10.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.11.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.11.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.12.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.12.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.13.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.13.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.14.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.14.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.15.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.15.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.16.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.16.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.17.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.17.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.18.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.18.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.19.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.19.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.20.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.20.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.21.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.21.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.22.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.22.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.23.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.23.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.24.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.24.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.25.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.25.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.26.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.26.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.27.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.27.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.28.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.28.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.29.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.29.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.30.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.30.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.31.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.31.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.32.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.32.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.33.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.33.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.34.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.34.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.35.self_attn.q_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.35.self_attn.o_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.3.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.3.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.4.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.4.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.5.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.5.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.6.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.6.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.7.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.7.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.8.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.8.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.9.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.9.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.10.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.10.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.11.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.11.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.12.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.12.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.13.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.13.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.14.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.14.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.15.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.15.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.16.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.16.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.17.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.17.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.18.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.18.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.19.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.19.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.20.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.20.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.21.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.21.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.22.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.22.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.23.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.23.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.24.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.24.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.25.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.25.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.26.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.26.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.27.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.27.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.28.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.28.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.29.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.29.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.30.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.30.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.31.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.31.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.32.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.32.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.33.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.33.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.34.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.34.self_attn.v_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.35.self_attn.k_proj.weight": "worker-000-003.safetensors",
|
||||
"model.layers.35.self_attn.v_proj.weight": "worker-000-003.safetensors"
|
||||
},
|
||||
"metadata": {
|
||||
"total_size": 6700486656
|
||||
}
|
||||
}
|
||||
439
script.py
Normal file
439
script.py
Normal file
@@ -0,0 +1,439 @@
|
||||
"""IOL-AI 2026 — M1 (/think) + Offelia-style techniques.
|
||||
|
||||
Keep Tiny Aya reasoning (/think). Add:
|
||||
- cardinality: count items, tell model exact N, truncate/pad
|
||||
- task-aware + phonetic-bracket detector (Offelia)
|
||||
- parser hygiene: drop essay lines after FINAL ANSWERS
|
||||
- targeted self-consistency only on match_letters / fill_blanks (k=3)
|
||||
- induction → apply (rules sheet then answers)
|
||||
"""
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def _install_bundled_deps() -> None:
|
||||
wheels_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "wheels")
|
||||
if not os.path.isdir(wheels_dir):
|
||||
return
|
||||
subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"pip",
|
||||
"install",
|
||||
"-q",
|
||||
"--no-index",
|
||||
f"--find-links={wheels_dir}",
|
||||
"transformers==4.56.2",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
|
||||
|
||||
_install_bundled_deps()
|
||||
|
||||
os.environ["HF_HUB_OFFLINE"] = "1"
|
||||
os.environ["TRANSFORMERS_OFFLINE"] = "1"
|
||||
MODEL_ID = "."
|
||||
USER_THINK_TOKEN = "/think"
|
||||
|
||||
import json
|
||||
import random
|
||||
import re
|
||||
from collections import Counter
|
||||
|
||||
import pandas as pd
|
||||
import torch
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
END_THINKING = "<|END_THINKING|>"
|
||||
START_THINKING = "<|START_THINKING|>"
|
||||
|
||||
THINKING_BUDGET = 1536
|
||||
ANSWER_CONTINUATION_TOKENS = 512
|
||||
COT_MAX_NEW_TOKENS = 1024
|
||||
INDUCT_MAX_NEW_TOKENS = 512
|
||||
THINK_TEMPERATURE = 0.6
|
||||
THINK_TOP_P = 0.95
|
||||
# Targeted SC only
|
||||
SC_TASKS = frozenset({"match_letters", "fill_blanks"})
|
||||
SC_K = 3
|
||||
SYSTEM = "" # instructions on user turn (best M1 private recipe)
|
||||
|
||||
TASK_INSTRUCTIONS = {
|
||||
"translation": (
|
||||
"This is a TRANSLATION task. Give only the translated form, in the language "
|
||||
"the task asks for. No explanation, no source form, just the translation."
|
||||
),
|
||||
"fill_blanks": (
|
||||
"This is a FILL-IN-THE-BLANKS task. Give only the missing form for each blank, "
|
||||
"nothing else."
|
||||
),
|
||||
"match_letters": (
|
||||
"This is a MATCHING task. Each numbered item must be answered with a SINGLE "
|
||||
"OPTION LETTER only (for example: C). Do NOT write the word, meaning, or "
|
||||
"translation -- only the letter that matches."
|
||||
),
|
||||
"text_to_num": (
|
||||
"This is a TEXT-TO-NUMBER task. Give the number in digits only (for example: 111)."
|
||||
),
|
||||
"num_to_text": (
|
||||
"This is a NUMBER-TO-TEXT task. Write the number out in words, in the language "
|
||||
"the task asks for. Give only the written-out form."
|
||||
),
|
||||
}
|
||||
TASK_DEFAULT = (
|
||||
"Give exactly what the instruction asks for, in the same form the examples use, "
|
||||
"and nothing else."
|
||||
)
|
||||
PHONETIC_INSTRUCTION = (
|
||||
"IMPORTANT -- this problem uses PHONETIC TRANSCRIPTION. The examples write forms "
|
||||
"inside square brackets, like [bø:va]. Your answers must be phonetic transcriptions "
|
||||
"in exactly that same notation: enclosed in square brackets, using the same phonetic "
|
||||
"symbols. Do NOT give an English meaning or gloss -- give the transcribed FORM."
|
||||
)
|
||||
_IPA_HINT = re.compile(
|
||||
r"[\u0250-\u02AF\u02B0-\u02FF\u0300-\u036F\u1D00-\u1D7Føœæðθŋɣʔ]"
|
||||
)
|
||||
_ASKS_NON_PHONETIC = re.compile(
|
||||
r"(?i)translate\s+into\s+english"
|
||||
r"|write\s+(it\s+)?in\s+the\s+[\w'\u2019-]+\s+orthography"
|
||||
r"|in\s+the\s+regular\s+orthography"
|
||||
)
|
||||
_ASKS_TRANSCRIPTION = re.compile(r"(?i)\b(transcribe|transcription|phonetic(ally)?)\b")
|
||||
_TURN_NOISE = re.compile(
|
||||
r"<\|/?END_OF_TURN_TOKEN\|>|<\|/?START_OF_TURN_TOKEN\|>|"
|
||||
r"<\|CHATBOT_TOKEN\|>|<EOS_TOKEN>|<BOS_TOKEN>"
|
||||
)
|
||||
_MARKER = re.compile(r"(?im)^\s*final answers?\s*:?\s*$")
|
||||
|
||||
|
||||
def _bracketed_forms(text: str) -> list[str]:
|
||||
out = []
|
||||
for m in re.finditer(r"\[([^\[\]\n]{1,40})\]", text):
|
||||
inner = m.group(1).strip()
|
||||
if not inner or re.fullmatch(r"[\d\s,.\-]+", inner):
|
||||
continue
|
||||
out.append(inner)
|
||||
return out
|
||||
|
||||
|
||||
def is_phonetic_task(context: str, query: str, min_forms: int = 3) -> bool:
|
||||
if _ASKS_NON_PHONETIC.search(query):
|
||||
return False
|
||||
if _bracketed_forms(query) and not _ASKS_TRANSCRIPTION.search(query):
|
||||
return False
|
||||
forms = _bracketed_forms(context) + _bracketed_forms(query)
|
||||
if len(forms) < min_forms:
|
||||
return False
|
||||
phonetic_looking = sum(1 for f in forms if _IPA_HINT.search(f) or ":" in f)
|
||||
return phonetic_looking >= max(2, len(forms) // 4)
|
||||
|
||||
|
||||
def count_items(query: str) -> int:
|
||||
n = len(re.findall(r"(?m)^\s*\d+[.)]", query))
|
||||
if n:
|
||||
return n
|
||||
if "blanks" in query.lower():
|
||||
m = re.search(r"\((\d+)-(\d+)\)", query)
|
||||
if m:
|
||||
return int(m.group(2)) - int(m.group(1)) + 1
|
||||
return len(re.findall(r"\(\d+\)", query)) or 0
|
||||
return 0
|
||||
|
||||
|
||||
def _looks_like_prose(line: str) -> bool:
|
||||
if re.search(
|
||||
r"(?i)^(final answers?|answers?|note|reviewing|summary|explanation|verification)\b.*:$",
|
||||
line,
|
||||
):
|
||||
return True
|
||||
if re.search(
|
||||
r"(?i)^(here (are|is)|the (final )?answers? (are|is)|based on|therefore|thus|"
|
||||
r"in summary|colors? are expressed|these stems)\b",
|
||||
line,
|
||||
):
|
||||
return True
|
||||
if line.rstrip().endswith(":") and len(line) > 3:
|
||||
return True
|
||||
if len(line) > 120:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _strip_gloss_keep_form(line: str) -> str:
|
||||
s = re.sub(r"\*\*", "", (line or "").strip())
|
||||
s = re.split(r"\s+_?(?:GCY|NS|N/A)_?\b", s, maxsplit=1, flags=re.I)[0].strip()
|
||||
m = re.match(
|
||||
r"^(.+?)\s+[-–—]\s+((?:to|the|a|an|in|of|for|being|means?)\b.*)$",
|
||||
s,
|
||||
flags=re.I,
|
||||
)
|
||||
if m:
|
||||
s = m.group(1).strip()
|
||||
return s.strip()
|
||||
|
||||
|
||||
def parse_answers(text: str, n_items: int = 0) -> list[str]:
|
||||
text = after_thinking(text)
|
||||
markers = list(_MARKER.finditer(text))
|
||||
if markers:
|
||||
text = text[markers[-1].end() :]
|
||||
answers = []
|
||||
for line in text.splitlines():
|
||||
line = re.sub(r"^\s*\d+[.)]\s*", "", line).strip().strip("`")
|
||||
if not line or _looks_like_prose(line):
|
||||
continue
|
||||
line = _strip_gloss_keep_form(line)
|
||||
if not line:
|
||||
continue
|
||||
# match_letters letter blob
|
||||
if re.fullmatch(r"(?:[A-Za-z]\s+)+[A-Za-z]", line):
|
||||
answers.extend([p.upper() for p in line.split()])
|
||||
continue
|
||||
answers.append(line)
|
||||
if n_items > 0:
|
||||
answers = answers[:n_items]
|
||||
if len(answers) < n_items:
|
||||
answers += [""] * (n_items - len(answers))
|
||||
return answers
|
||||
|
||||
|
||||
def after_thinking(text: str) -> str:
|
||||
if END_THINKING in text:
|
||||
text = text.rsplit(END_THINKING, 1)[-1]
|
||||
elif START_THINKING in text:
|
||||
text = ""
|
||||
return _TURN_NOISE.sub("", text)
|
||||
|
||||
|
||||
def build_instructions(task_type: str, context: str, query: str) -> str:
|
||||
specific = TASK_INSTRUCTIONS.get(str(task_type).strip().lower(), TASK_DEFAULT)
|
||||
parts = [
|
||||
"You solve International Linguistics Olympiad (IOL) problems from the data you are given.",
|
||||
specific,
|
||||
"Put answers ONLY after a line that says exactly: FINAL ANSWERS:",
|
||||
"Bare answers only: no numbering, no quotes, no commentary, no _GCY/_NS glosses.",
|
||||
"Never dump the alphabet. Never write an essay under FINAL ANSWERS:.",
|
||||
]
|
||||
if is_phonetic_task(context, query):
|
||||
parts.append(PHONETIC_INSTRUCTION)
|
||||
return "\n\n".join(parts)
|
||||
|
||||
|
||||
def build_user(
|
||||
instructions: str,
|
||||
context: str,
|
||||
query: str,
|
||||
*,
|
||||
n_items: int,
|
||||
think_token: str = "",
|
||||
rules: str = "",
|
||||
mode: str = "answer",
|
||||
) -> str:
|
||||
parts = [instructions.strip(), "", context.strip()]
|
||||
if rules.strip():
|
||||
parts += ["", "RULES:", rules.strip()]
|
||||
parts += ["", query.strip()]
|
||||
if mode == "induct":
|
||||
parts += [
|
||||
"",
|
||||
"Deduce linguistic RULES from CONTEXT only. Do NOT answer QUERY.",
|
||||
"Write a bullet list under a line that says exactly: RULES:",
|
||||
]
|
||||
elif n_items > 0:
|
||||
parts += [
|
||||
"",
|
||||
f"There are exactly {n_items} items to answer. "
|
||||
f"Give exactly {n_items} answers after FINAL ANSWERS:, "
|
||||
"one per line, no more and no fewer.",
|
||||
]
|
||||
if think_token:
|
||||
parts.append(think_token.strip())
|
||||
return "\n".join(parts)
|
||||
|
||||
|
||||
def _end_thinking_id(tok) -> int:
|
||||
end_id = tok.convert_tokens_to_ids(END_THINKING)
|
||||
if end_id is None or end_id == tok.unk_token_id:
|
||||
ids = tok.encode(END_THINKING, add_special_tokens=False)
|
||||
if len(ids) == 1:
|
||||
end_id = ids[0]
|
||||
if end_id is None or end_id == tok.unk_token_id:
|
||||
raise RuntimeError(f"missing {END_THINKING}")
|
||||
return int(end_id)
|
||||
|
||||
|
||||
def _build_prompt_ids(tok, user: str, *, thinking: bool):
|
||||
messages = [{"role": "user", "content": user}]
|
||||
try:
|
||||
return tok.apply_chat_template(
|
||||
messages,
|
||||
add_generation_prompt=True,
|
||||
return_tensors="pt",
|
||||
reasoning_options={"enabled": thinking},
|
||||
)
|
||||
except TypeError:
|
||||
return tok.apply_chat_template(
|
||||
messages, add_generation_prompt=True, return_tensors="pt"
|
||||
)
|
||||
|
||||
|
||||
@torch.inference_mode()
|
||||
def generate_with_think(
|
||||
model,
|
||||
tok,
|
||||
prompt_ids,
|
||||
end_id: int,
|
||||
*,
|
||||
sample_think: bool,
|
||||
think_budget: int = THINKING_BUDGET,
|
||||
answer_tokens: int = ANSWER_CONTINUATION_TOKENS,
|
||||
):
|
||||
device = next(model.parameters()).device
|
||||
prompt_ids = prompt_ids.to(device)
|
||||
prompt_len = prompt_ids.shape[-1]
|
||||
think_kw = (
|
||||
dict(do_sample=True, temperature=THINK_TEMPERATURE, top_p=THINK_TOP_P)
|
||||
if sample_think
|
||||
else dict(do_sample=False)
|
||||
)
|
||||
think_out = model.generate(
|
||||
prompt_ids,
|
||||
max_new_tokens=think_budget,
|
||||
pad_token_id=tok.pad_token_id or tok.eos_token_id,
|
||||
**think_kw,
|
||||
)[0]
|
||||
gen_ids = think_out[prompt_len:].tolist()
|
||||
if end_id not in gen_ids:
|
||||
cont = torch.cat(
|
||||
[think_out, torch.tensor([end_id], device=device, dtype=think_out.dtype)]
|
||||
)
|
||||
else:
|
||||
cont = think_out
|
||||
# greedy answer
|
||||
full = model.generate(
|
||||
cont.unsqueeze(0),
|
||||
max_new_tokens=answer_tokens,
|
||||
do_sample=False,
|
||||
pad_token_id=tok.pad_token_id or tok.eos_token_id,
|
||||
)[0]
|
||||
return _TURN_NOISE.sub("", tok.decode(full[prompt_len:], skip_special_tokens=False)).strip()
|
||||
|
||||
|
||||
@torch.inference_mode()
|
||||
def generate_plain(model, tok, prompt_ids, max_new: int, *, sample: bool = False):
|
||||
device = next(model.parameters()).device
|
||||
prompt_ids = prompt_ids.to(device)
|
||||
prompt_len = prompt_ids.shape[-1]
|
||||
kw = (
|
||||
dict(do_sample=True, temperature=0.6, top_p=0.95)
|
||||
if sample
|
||||
else dict(do_sample=False)
|
||||
)
|
||||
out = model.generate(
|
||||
prompt_ids,
|
||||
max_new_tokens=max_new,
|
||||
pad_token_id=tok.pad_token_id or tok.eos_token_id,
|
||||
**kw,
|
||||
)[0]
|
||||
return _TURN_NOISE.sub("", tok.decode(out[prompt_len:], skip_special_tokens=False)).strip()
|
||||
|
||||
|
||||
def majority_vote(samples: list[list[str]], n_items: int) -> list[str]:
|
||||
usable = [s for s in samples if any(x.strip() for x in s)]
|
||||
if not usable:
|
||||
return [""] * max(n_items, 0)
|
||||
n = n_items or max(len(s) for s in usable)
|
||||
padded = [(list(s) + [""] * n)[:n] for s in usable]
|
||||
# prefer full-tuple agreement
|
||||
counts = Counter(tuple(p) for p in padded)
|
||||
best, c = counts.most_common(1)[0]
|
||||
if c >= 2:
|
||||
return list(best)
|
||||
return [Counter(p[i] for p in padded).most_common(1)[0][0] for i in range(n)]
|
||||
|
||||
|
||||
def extract_rules(text: str) -> str:
|
||||
text = after_thinking(text)
|
||||
m = list(re.finditer(r"(?im)^\s*rules?\s*:?\s*$", text))
|
||||
if m:
|
||||
return text[m[-1].end() :].strip()[:2000]
|
||||
return text.strip()[:2000]
|
||||
|
||||
|
||||
tok = AutoTokenizer.from_pretrained(MODEL_ID)
|
||||
end_id = _end_thinking_id(tok)
|
||||
model = AutoModelForCausalLM.from_pretrained(
|
||||
MODEL_ID, torch_dtype=torch.float16, device_map="auto"
|
||||
).eval()
|
||||
|
||||
df = pd.read_csv("/tmp/data/test.csv", dtype=str).fillna("")
|
||||
rows = []
|
||||
for i, r in df.iterrows():
|
||||
task = str(r.get("task_type", "") or "")
|
||||
n_items = count_items(r["query"])
|
||||
instr = build_instructions(task, r["context"], r["query"])
|
||||
|
||||
# Pass A: induction (greedy think)
|
||||
induct_user = build_user(
|
||||
instr,
|
||||
r["context"],
|
||||
r["query"],
|
||||
n_items=0,
|
||||
think_token=USER_THINK_TOKEN,
|
||||
mode="induct",
|
||||
)
|
||||
induct_ids = _build_prompt_ids(tok, induct_user, thinking=True)
|
||||
# Short greedy think for rules only — keep T4 headroom for answer (+ SC).
|
||||
induct_text = generate_with_think(
|
||||
model,
|
||||
tok,
|
||||
induct_ids,
|
||||
end_id,
|
||||
sample_think=False,
|
||||
think_budget=INDUCT_MAX_NEW_TOKENS,
|
||||
answer_tokens=256,
|
||||
)
|
||||
rules = extract_rules(induct_text)
|
||||
|
||||
# Pass B: answer with rules
|
||||
def one_answer(seed: int, sample_think: bool) -> list[str]:
|
||||
torch.manual_seed(seed)
|
||||
if torch.cuda.is_available():
|
||||
torch.cuda.manual_seed_all(seed)
|
||||
user = build_user(
|
||||
instr,
|
||||
r["context"],
|
||||
r["query"],
|
||||
n_items=n_items,
|
||||
think_token=USER_THINK_TOKEN,
|
||||
rules=rules,
|
||||
mode="answer",
|
||||
)
|
||||
ids = _build_prompt_ids(tok, user, thinking=True)
|
||||
text = generate_with_think(
|
||||
model, tok, ids, end_id, sample_think=sample_think
|
||||
)
|
||||
return parse_answers(text, n_items=n_items)
|
||||
|
||||
if task in SC_TASKS:
|
||||
samples = [
|
||||
one_answer(1000 + int(i) * 97 + k * 17, sample_think=True)
|
||||
for k in range(SC_K)
|
||||
]
|
||||
answers = majority_vote(samples, n_items)
|
||||
print(f" targeted SC k={SC_K} task={task}", flush=True)
|
||||
else:
|
||||
answers = one_answer(1000 + int(i) * 97, sample_think=True)
|
||||
|
||||
# Fallback: no-rules single greedy think if mostly empty
|
||||
if n_items > 0 and sum(1 for a in answers if a.strip()) < max(1, n_items // 2):
|
||||
answers = one_answer(42 + int(i), sample_think=False)
|
||||
|
||||
rows.append({"id": r["id"], "pred": json.dumps(answers, ensure_ascii=False)})
|
||||
pd.DataFrame(rows).to_csv("submission.csv", index=False)
|
||||
print(f"[{i + 1}/{len(df)}] n={n_items} got={len(answers)} phon={is_phonetic_task(r['context'], r['query'])}", flush=True)
|
||||
|
||||
print("wrote submission.csv", flush=True)
|
||||
40
special_tokens_map.json
Normal file
40
special_tokens_map.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"bos_token": {
|
||||
"content": "<BOS_TOKEN>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"eos_token": {
|
||||
"content": "<EOS_TOKEN>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"pad_token": {
|
||||
"content": "<PAD>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"unk_token": {
|
||||
"content": "<UNK>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"additional_special_tokens": [
|
||||
"<|START_RESPONSE|>",
|
||||
"<|END_RESPONSE|>",
|
||||
"<|START_ACTION|>",
|
||||
"<|END_ACTION|>",
|
||||
"<|START_TOOL_RESULT|>",
|
||||
"<|END_TOOL_RESULT|>",
|
||||
"<|START_THINKING|>",
|
||||
"<|END_THINKING|>"
|
||||
]
|
||||
}
|
||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:55388a861271fb6b9eb631670e5eee0562bcddf204dc63494d98ee67f5551839
|
||||
size 30245131
|
||||
202
tokenizer_config.json
Normal file
202
tokenizer_config.json
Normal file
@@ -0,0 +1,202 @@
|
||||
{
|
||||
"add_bos_token": true,
|
||||
"add_eos_token": false,
|
||||
"add_prefix_space": false,
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"legacy": true,
|
||||
"spaces_between_special_tokens": false,
|
||||
"use_default_system_prompt": false,
|
||||
"bos_token": "<BOS_TOKEN>",
|
||||
"eos_token": "<EOS_TOKEN>",
|
||||
"pad_token": "<PAD>",
|
||||
"unk_token": "<UNK>",
|
||||
"tokenizer_class": "CohereTokenizerFast",
|
||||
"model_max_length": 1000000000000000019884624838656,
|
||||
"sp_model_kwargs": {},
|
||||
"added_tokens_decoder": {
|
||||
"0": {
|
||||
"content": "<PAD>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"1": {
|
||||
"content": "<MASK_TOKEN>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"2": {
|
||||
"content": "<BOS_TOKEN>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"3": {
|
||||
"content": "<EOS_TOKEN>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"4": {
|
||||
"content": "<UNK>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"5": {
|
||||
"content": "<|START_OF_TURN_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"6": {
|
||||
"content": "<|END_OF_TURN_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"7": {
|
||||
"content": "<|USER_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"8": {
|
||||
"content": "<|CHATBOT_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"9": {
|
||||
"content": "<|SYSTEM_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"10": {
|
||||
"content": "<|NEW_FILE|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"11": {
|
||||
"content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"12": {
|
||||
"content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"13": {
|
||||
"content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"14": {
|
||||
"content": "<|END_OF_MIDDLE_FIM_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"261000": {
|
||||
"content": "<|START_RESPONSE|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"261001": {
|
||||
"content": "<|END_RESPONSE|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"261002": {
|
||||
"content": "<|START_ACTION|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"261003": {
|
||||
"content": "<|END_ACTION|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"261004": {
|
||||
"content": "<|START_TOOL_RESULT|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"261005": {
|
||||
"content": "<|END_TOOL_RESULT|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"261006": {
|
||||
"content": "<|START_THINKING|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"261007": {
|
||||
"content": "<|END_THINKING|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
}
|
||||
}
|
||||
}
|
||||
3
wheels/certifi-2026.6.17-py3-none-any.whl
Normal file
3
wheels/certifi-2026.6.17-py3-none-any.whl
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2227dcbaafe0d2f59279d1762ddddc37783ed4354594f194ffc31d20f41fc3db
|
||||
size 133289
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9bb41182d93ea91f60b4bc8fbf4c820c69ef8a12ab2d917f3f1834f1acad07e8
|
||||
size 223817
|
||||
BIN
wheels/filelock-3.29.7-py3-none-any.whl
Normal file
BIN
wheels/filelock-3.29.7-py3-none-any.whl
Normal file
Binary file not shown.
3
wheels/fsspec-2026.6.0-py3-none-any.whl
Normal file
3
wheels/fsspec-2026.6.0-py3-none-any.whl
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:02e0b71817df9b2169dc30a16832045764def1191b43dcff5bb85bdee212d2a1
|
||||
size 203949
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:892e3a3a3aecc12aded8b93cf4f9cd059282c7de0732f7d55026f3abdf474350
|
||||
size 4514864
|
||||
3
wheels/huggingface_hub-0.36.2-py3-none-any.whl
Normal file
3
wheels/huggingface_hub-0.36.2-py3-none-any.whl
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:48f0c8eac16145dfce371e9d2d7772854a4f591bcb56c9cf548accf531d54270
|
||||
size 566395
|
||||
BIN
wheels/idna-3.18-py3-none-any.whl
Normal file
BIN
wheels/idna-3.18-py3-none-any.whl
Normal file
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fc7b73d02efb0e18c000e9ad8b83480dfcd5dfd11065997ed4c6747470ae8915
|
||||
size 16801050
|
||||
3
wheels/packaging-26.2-py3-none-any.whl
Normal file
3
wheels/packaging-26.2-py3-none-any.whl
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e
|
||||
size 100195
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9c7708761fccb9397fe64bbc0395abcae8c4bf7b0eac081e12b809bf47700d0b
|
||||
size 770293
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:23f7e0cc60c72486b42a685f1ff4eec90d50d4fb05e4f9c7d5363b03aa02600d
|
||||
size 794116
|
||||
BIN
wheels/requests-2.34.2-py3-none-any.whl
Normal file
BIN
wheels/requests-2.34.2-py3-none-any.whl
Normal file
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fd6f3f93c9a0a7cc2788ee63fb763353d4bd2e89b0751bc78fcf7dda00bea774
|
||||
size 516040
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:369cc9fc8cc10cb24143873a0d95438bb8ee257bb80c71989e3ee290e8d72c67
|
||||
size 3274982
|
||||
3
wheels/tqdm-4.68.4-py3-none-any.whl
Normal file
3
wheels/tqdm-4.68.4-py3-none-any.whl
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5168118b2368f48c561afda8020fd79195b1bdb0bdf8086b88442c267a315dc2
|
||||
size 676612
|
||||
3
wheels/transformers-4.56.2-py3-none-any.whl
Normal file
3
wheels/transformers-4.56.2-py3-none-any.whl
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:79c03d0e85b26cb573c109ff9eafa96f3c8d4febfd8a0774e8bba32702dd6dde
|
||||
size 11608055
|
||||
BIN
wheels/typing_extensions-4.16.0-py3-none-any.whl
Normal file
BIN
wheels/typing_extensions-4.16.0-py3-none-any.whl
Normal file
Binary file not shown.
3
wheels/urllib3-2.7.0-py3-none-any.whl
Normal file
3
wheels/urllib3-2.7.0-py3-none-any.whl
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897
|
||||
size 131087
|
||||
3
worker-000-000.safetensors
Normal file
3
worker-000-000.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0d6579e1743cc538bcaa0cd19d3ed04ce4b05174698c8966cdaf97662c7e90fc
|
||||
size 1998698496
|
||||
3
worker-000-001.safetensors
Normal file
3
worker-000-001.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:512538fadfbd6297ef63f9981a49a06574a62bb374976b64c172c540a1ff23ca
|
||||
size 1996494056
|
||||
3
worker-000-002.safetensors
Normal file
3
worker-000-002.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:db012a51920562e845fdd9bd45d37233d72fa0cbc1669338dd8f07175d767435
|
||||
size 1996494088
|
||||
3
worker-000-003.safetensors
Normal file
3
worker-000-003.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ae0ae8f50125c2a9bfe05b7df93769f54cf94fe8a910718a03222f0da7ad82f2
|
||||
size 708852792
|
||||
Reference in New Issue
Block a user