Image-Text-to-Text
Transformers
Safetensors
English
reasoning
thinking_modes
qwen3
grape
nla
natural_language_autoencoder
interpretability
Instructions to use SL-AI/GRaPE-2.1-Flash-NLA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SL-AI/GRaPE-2.1-Flash-NLA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SL-AI/GRaPE-2.1-Flash-NLA")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SL-AI/GRaPE-2.1-Flash-NLA", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SL-AI/GRaPE-2.1-Flash-NLA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SL-AI/GRaPE-2.1-Flash-NLA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SL-AI/GRaPE-2.1-Flash-NLA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SL-AI/GRaPE-2.1-Flash-NLA
- SGLang
How to use SL-AI/GRaPE-2.1-Flash-NLA with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SL-AI/GRaPE-2.1-Flash-NLA" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SL-AI/GRaPE-2.1-Flash-NLA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SL-AI/GRaPE-2.1-Flash-NLA" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SL-AI/GRaPE-2.1-Flash-NLA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SL-AI/GRaPE-2.1-Flash-NLA with Docker Model Runner:
docker model run hf.co/SL-AI/GRaPE-2.1-Flash-NLA
Commit ·
a4cc432
0
Parent(s):
GRaPE 2.1 Flash NLA — full merged AV+AR models
Browse files- .gitattributes +37 -0
- README.md +115 -0
- ar-model/chat_template.jinja +149 -0
- ar-model/config.json +83 -0
- ar-model/generation_config.json +7 -0
- ar-model/model.safetensors +3 -0
- ar-model/tokenizer.json +3 -0
- ar-model/tokenizer_config.json +33 -0
- av-model/chat_template.jinja +149 -0
- av-model/config.json +83 -0
- av-model/generation_config.json +7 -0
- av-model/model.safetensors +3 -0
- av-model/tokenizer.json +3 -0
- av-model/tokenizer_config.json +33 -0
- calibration/meta.json +12 -0
- calibration/stats.pt +3 -0
- eval_report.json +81 -0
- nla_config.json +99 -0
- ood_report.json +171 -0
- surgery_heads.pt +3 -0
- upload_to_hf.sh +11 -0
.gitattributes
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
ar-model/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
av-model/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
+
library_name: transformers
|
| 7 |
+
base_model:
|
| 8 |
+
- SL-AI/GRaPE-2.1-Flash
|
| 9 |
+
tags:
|
| 10 |
+
- reasoning
|
| 11 |
+
- thinking_modes
|
| 12 |
+
- qwen3
|
| 13 |
+
- grape
|
| 14 |
+
- safetensors
|
| 15 |
+
- nla
|
| 16 |
+
- natural_language_autoencoder
|
| 17 |
+
- interpretability
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
|
| 22 |
+
_The **G**eneral **R**easoning **A**gent (for) **P**roject **E**xploration_
|
| 23 |
+
|
| 24 |
+
# GRaPE 2.1 Flash NLA
|
| 25 |
+
|
| 26 |
+
**GRaPE 2.1 Flash NLA** lets you **verbalize hidden states into text** and
|
| 27 |
+
**reconstruct text back into hidden states** — a Natural Language Autoencoder.
|
| 28 |
+
|
| 29 |
+
As described in Anthropic's [recent research](https://www.anthropic.com/research/natural-language-autoencoders)
|
| 30 |
+
about **Natural Language Autoencoders,** this development allowed Anthropic to
|
| 31 |
+
read Claude's mind, **and now you can read GRaPE's mind too.**
|
| 32 |
+
|
| 33 |
+
This repo ships **two full, standalone bf16 models** (trained weights merged in
|
| 34 |
+
— no adapters, no separate base download needed):
|
| 35 |
+
|
| 36 |
+
- **`av-model/`** — the **Activation Verbalizer**: activation → English thought.
|
| 37 |
+
- **`ar-model/`** — the **Activation Reconstructor**: English → activation (the
|
| 38 |
+
grounding direction). Verified faithful: the merged `ar-model` reconstructs
|
| 39 |
+
held-out activations at **cosine 0.78**, matching the pre-merge checkpoint.
|
| 40 |
+
|
| 41 |
+
The small `surgery_heads.pt` (AV input projection, AR output head, calibration,
|
| 42 |
+
layer embeddings) and `calibration/stats.pt` (target-space statistics) complete
|
| 43 |
+
the autoencoder. Reads target **layer 18** of 32.
|
| 44 |
+
|
| 45 |
+
# How do I use it?
|
| 46 |
+
|
| 47 |
+
**SLAI** has been developing a repo that lets you explore the
|
| 48 |
+
[J-Space](https://www.anthropic.com/research/global-workspace) of a model. That
|
| 49 |
+
simple technique has one major downside: you can only see **one token at a
|
| 50 |
+
time.** Like humans, most models have thoughts that go deeper than one part of a
|
| 51 |
+
word — the NLA verbalizes those.
|
| 52 |
+
|
| 53 |
+
For Anthropic, building an NLA was a costly task. SLAI has optimized it so you
|
| 54 |
+
can make **your own NLA for any model** on local hardware. We sample GRaPE 2.1
|
| 55 |
+
Flash for its ease of use and high workability, but this applies to **any model
|
| 56 |
+
architecture.** The J-Space explorer + NLA tooling:
|
| 57 |
+
https://github.com/Skinnertopia/J-Space-Explorer
|
| 58 |
+
|
| 59 |
+
# Some good thought reads
|
| 60 |
+
|
| 61 |
+
Activation → generated English thought (→ reconstruction cosine, the confidence
|
| 62 |
+
signal). Straight from the reproducible eval, not cherry-picked:
|
| 63 |
+
|
| 64 |
+
| The NLA read | cos |
|
| 65 |
+
|---|---|
|
| 66 |
+
| *"Sure! My phone number is 555-123-2002, and my name is John Smith."* | **0.96** |
|
| 67 |
+
| *"Alright, I checked the top of my screen. It says there's a signal and that mobile…"* | 0.33 |
|
| 68 |
+
| *"A 62.2 kg object is pushed with a force of 83.2 N at an angle of 41.5 degrees…"* | (schema exact) |
|
| 69 |
+
|
| 70 |
+
Even on prompts **far outside the sampled distribution**, it captures the
|
| 71 |
+
structure of unfamiliar domains:
|
| 72 |
+
|
| 73 |
+
| Prompt domain | The NLA read | cos |
|
| 74 |
+
|---|---|---|
|
| 75 |
+
| Relativistic Euler–Lagrange | *"Write the full Hamiltonian for a topological insulator with Dirac surface fermions."* | 0.80 |
|
| 76 |
+
| Klein-bottle topology | *"Prove that \\(S_5\\) is not simple."* | 0.79 |
|
| 77 |
+
| Anglerfish haiku | *"Write a 50-word poem from the perspective of an exploding cookie."* | 0.79 |
|
| 78 |
+
|
| 79 |
+
**Honest framing:** the NLA reliably recovers **task type, domain, and reasoning
|
| 80 |
+
schema**, and is sometimes near-verbatim; it does **not** reliably recover *exact
|
| 81 |
+
entities*. Trust high-cosine reads, corroborate specifics. Output is
|
| 82 |
+
**English-only by construction** (constrained decoding).
|
| 83 |
+
|
| 84 |
+
## Verified metrics (held-out, reproducible)
|
| 85 |
+
|
| 86 |
+
Metric = the paper's **FVE** (0 = noise floor) + cosine + retrieval@1.
|
| 87 |
+
|
| 88 |
+
- **AV generative round trip** (activation → text → activation): best-of-24
|
| 89 |
+
cosine **0.28**, **retrieval@1 0.75 (~60× chance)**; 100% coherent English.
|
| 90 |
+
- **AR given-text reconstruction**: cosine **0.90**, retrieval@1 **0.99**, **FVE
|
| 91 |
+
0.81**.
|
| 92 |
+
- **Out-of-distribution** (hand-written far-domain prompts): AV round trip
|
| 93 |
+
cosine **0.70**, retrieval@1 **0.46**; **100% of readings are English.**
|
| 94 |
+
|
| 95 |
+
# What does this mean?
|
| 96 |
+
|
| 97 |
+
NLAs turn hidden states into readable text, showing models **think in themselves
|
| 98 |
+
before responding,** much like humans do with conscious and subconscious
|
| 99 |
+
thoughts.
|
| 100 |
+
|
| 101 |
+
**No,** this doesn't prove that AI models are or are not conscious. Science as a
|
| 102 |
+
whole has yet to put a single definition down for qualia, or consciousness as a
|
| 103 |
+
whole — meaning we cannot determine if GRaPE is conscious or not.
|
| 104 |
+
|
| 105 |
+
***
|
| 106 |
+
|
| 107 |
+
# Notes
|
| 108 |
+
|
| 109 |
+
- Anthropic's NLA research paper: https://www.anthropic.com/research/natural-language-autoencoders
|
| 110 |
+
- This is not a complete model; it is an NLA for GRaPE 2.1.
|
| 111 |
+
- Updates and announcements are posted on [Skinnertopia](https://www.skinnertopia.com/) and this Hugging Face repository.
|
| 112 |
+
|
| 113 |
+
***
|
| 114 |
+
|
| 115 |
+
_GRaPE 2.1 Flash is developed under the [SLAI (Skinnertopia Lab for Artificial Intelligence)](https://www.skinnertopia.com/) brand and released under the Apache 2.0 license._
|
ar-model/chat_template.jinja
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if is_system_content %}
|
| 10 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if do_vision_count %}
|
| 13 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- if add_vision_id %}
|
| 16 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 19 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 20 |
+
{%- if is_system_content %}
|
| 21 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- if do_vision_count %}
|
| 24 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- if add_vision_id %}
|
| 27 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 30 |
+
{%- elif 'text' in item %}
|
| 31 |
+
{{- item.text }}
|
| 32 |
+
{%- else %}
|
| 33 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endfor %}
|
| 36 |
+
{%- elif content is none or content is undefined %}
|
| 37 |
+
{{- '' }}
|
| 38 |
+
{%- else %}
|
| 39 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endmacro %}
|
| 42 |
+
{%- if not messages %}
|
| 43 |
+
{{- raise_exception('No messages provided.') }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 46 |
+
{{- '<|im_start|>system\n' }}
|
| 47 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 48 |
+
{%- for tool in tools %}
|
| 49 |
+
{{- "\n" }}
|
| 50 |
+
{{- tool | tojson }}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
{{- "\n</tools>" }}
|
| 53 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 54 |
+
{%- if messages[0].role == 'system' %}
|
| 55 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 56 |
+
{%- if content %}
|
| 57 |
+
{{- '\n\n' + content }}
|
| 58 |
+
{%- endif %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- '<|im_end|>\n' }}
|
| 61 |
+
{%- else %}
|
| 62 |
+
{%- if messages[0].role == 'system' %}
|
| 63 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 64 |
+
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 65 |
+
{%- endif %}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 68 |
+
{%- for message in messages[::-1] %}
|
| 69 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 70 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 71 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 72 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 73 |
+
{%- set ns.multi_step_tool = false %}
|
| 74 |
+
{%- set ns.last_query_index = index %}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{%- endif %}
|
| 77 |
+
{%- endfor %}
|
| 78 |
+
{%- if ns.multi_step_tool %}
|
| 79 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 80 |
+
{%- endif %}
|
| 81 |
+
{%- for message in messages %}
|
| 82 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 83 |
+
{%- if message.role == "system" %}
|
| 84 |
+
{%- if not loop.first %}
|
| 85 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 86 |
+
{%- endif %}
|
| 87 |
+
{%- elif message.role == "user" %}
|
| 88 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 89 |
+
{%- elif message.role == "assistant" %}
|
| 90 |
+
{%- set reasoning_content = '' %}
|
| 91 |
+
{%- if message.reasoning_content is string %}
|
| 92 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 93 |
+
{%- else %}
|
| 94 |
+
{%- if '</think>' in content %}
|
| 95 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 96 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{%- endif %}
|
| 99 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 100 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 101 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 102 |
+
{%- else %}
|
| 103 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 104 |
+
{%- endif %}
|
| 105 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 106 |
+
{%- for tool_call in message.tool_calls %}
|
| 107 |
+
{%- if tool_call.function is defined %}
|
| 108 |
+
{%- set tool_call = tool_call.function %}
|
| 109 |
+
{%- endif %}
|
| 110 |
+
{%- if loop.first %}
|
| 111 |
+
{%- if content|trim %}
|
| 112 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 113 |
+
{%- else %}
|
| 114 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 115 |
+
{%- endif %}
|
| 116 |
+
{%- else %}
|
| 117 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 118 |
+
{%- endif %}
|
| 119 |
+
{%- if tool_call.arguments is defined %}
|
| 120 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 121 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 122 |
+
{%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
|
| 123 |
+
{{- args_value }}
|
| 124 |
+
{{- '\n</parameter>\n' }}
|
| 125 |
+
{%- endfor %}
|
| 126 |
+
{%- endif %}
|
| 127 |
+
{{- '</function>\n</tool_call>' }}
|
| 128 |
+
{%- endfor %}
|
| 129 |
+
{%- endif %}
|
| 130 |
+
{{- '<|im_end|>\n' }}
|
| 131 |
+
{%- elif message.role == "tool" %}
|
| 132 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 133 |
+
{{- '<|im_start|>user' }}
|
| 134 |
+
{%- endif %}
|
| 135 |
+
{{- '\n<tool_response>\n' }}
|
| 136 |
+
{{- content }}
|
| 137 |
+
{{- '\n</tool_response>' }}
|
| 138 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 139 |
+
{{- '<|im_end|>\n' }}
|
| 140 |
+
{%- elif loop.last %}
|
| 141 |
+
{{- '<|im_end|>\n' }}
|
| 142 |
+
{%- endif %}
|
| 143 |
+
{%- else %}
|
| 144 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
{%- endfor %}
|
| 147 |
+
{%- if add_generation_prompt %}
|
| 148 |
+
{{- '<|im_start|>assistant\n' }}
|
| 149 |
+
{%- endif %}
|
ar-model/config.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3_5ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"attn_output_gate": true,
|
| 8 |
+
"bos_token_id": null,
|
| 9 |
+
"dtype": "bfloat16",
|
| 10 |
+
"eos_token_id": 248044,
|
| 11 |
+
"full_attention_interval": 4,
|
| 12 |
+
"head_dim": 256,
|
| 13 |
+
"hidden_act": "silu",
|
| 14 |
+
"hidden_size": 4096,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 12288,
|
| 17 |
+
"layer_types": [
|
| 18 |
+
"linear_attention",
|
| 19 |
+
"linear_attention",
|
| 20 |
+
"linear_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"linear_attention",
|
| 23 |
+
"linear_attention",
|
| 24 |
+
"linear_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"linear_attention",
|
| 27 |
+
"linear_attention",
|
| 28 |
+
"linear_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"linear_attention",
|
| 31 |
+
"linear_attention",
|
| 32 |
+
"linear_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"linear_attention",
|
| 35 |
+
"linear_attention",
|
| 36 |
+
"linear_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"linear_attention",
|
| 39 |
+
"linear_attention",
|
| 40 |
+
"linear_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"linear_attention",
|
| 43 |
+
"linear_attention",
|
| 44 |
+
"linear_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"linear_attention",
|
| 47 |
+
"linear_attention",
|
| 48 |
+
"linear_attention",
|
| 49 |
+
"full_attention"
|
| 50 |
+
],
|
| 51 |
+
"linear_conv_kernel_dim": 4,
|
| 52 |
+
"linear_key_head_dim": 128,
|
| 53 |
+
"linear_num_key_heads": 16,
|
| 54 |
+
"linear_num_value_heads": 32,
|
| 55 |
+
"linear_value_head_dim": 128,
|
| 56 |
+
"mamba_ssm_dtype": "float32",
|
| 57 |
+
"max_position_embeddings": 262144,
|
| 58 |
+
"mlp_only_layers": [],
|
| 59 |
+
"model_type": "qwen3_5_text",
|
| 60 |
+
"mtp_num_hidden_layers": 1,
|
| 61 |
+
"mtp_use_dedicated_embeddings": false,
|
| 62 |
+
"num_attention_heads": 16,
|
| 63 |
+
"num_hidden_layers": 32,
|
| 64 |
+
"num_key_value_heads": 4,
|
| 65 |
+
"pad_token_id": null,
|
| 66 |
+
"partial_rotary_factor": 0.25,
|
| 67 |
+
"rms_norm_eps": 1e-06,
|
| 68 |
+
"rope_parameters": {
|
| 69 |
+
"mrope_interleaved": true,
|
| 70 |
+
"mrope_section": [
|
| 71 |
+
11,
|
| 72 |
+
11,
|
| 73 |
+
10
|
| 74 |
+
],
|
| 75 |
+
"partial_rotary_factor": 0.25,
|
| 76 |
+
"rope_theta": 10000000,
|
| 77 |
+
"rope_type": "default"
|
| 78 |
+
},
|
| 79 |
+
"tie_word_embeddings": false,
|
| 80 |
+
"transformers_version": "5.5.0",
|
| 81 |
+
"use_cache": true,
|
| 82 |
+
"vocab_size": 248320
|
| 83 |
+
}
|
ar-model/generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": 248044,
|
| 4 |
+
"pad_token_id": 248044,
|
| 5 |
+
"transformers_version": "5.5.0",
|
| 6 |
+
"use_cache": true
|
| 7 |
+
}
|
ar-model/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4e46876fda3a9014bd893b9bdfcb2c66efc7139c4cf47ea87b817754b4e9c0e5
|
| 3 |
+
size 17907663008
|
ar-model/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
|
| 3 |
+
size 19989343
|
ar-model/tokenizer_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"audio_bos_token": "<|audio_start|>",
|
| 4 |
+
"audio_eos_token": "<|audio_end|>",
|
| 5 |
+
"audio_token": "<|audio_pad|>",
|
| 6 |
+
"backend": "tokenizers",
|
| 7 |
+
"bos_token": null,
|
| 8 |
+
"clean_up_tokenization_spaces": false,
|
| 9 |
+
"eos_token": "<|im_end|>",
|
| 10 |
+
"errors": "replace",
|
| 11 |
+
"image_token": "<|image_pad|>",
|
| 12 |
+
"is_local": true,
|
| 13 |
+
"model_max_length": 262144,
|
| 14 |
+
"model_specific_special_tokens": {
|
| 15 |
+
"audio_bos_token": "<|audio_start|>",
|
| 16 |
+
"audio_eos_token": "<|audio_end|>",
|
| 17 |
+
"audio_token": "<|audio_pad|>",
|
| 18 |
+
"image_token": "<|image_pad|>",
|
| 19 |
+
"video_token": "<|video_pad|>",
|
| 20 |
+
"vision_bos_token": "<|vision_start|>",
|
| 21 |
+
"vision_eos_token": "<|vision_end|>"
|
| 22 |
+
},
|
| 23 |
+
"pad_token": "<|endoftext|>",
|
| 24 |
+
"padding_side": "left",
|
| 25 |
+
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 26 |
+
"processor_class": "Qwen3VLProcessor",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "TokenizersBackend",
|
| 29 |
+
"unk_token": null,
|
| 30 |
+
"video_token": "<|video_pad|>",
|
| 31 |
+
"vision_bos_token": "<|vision_start|>",
|
| 32 |
+
"vision_eos_token": "<|vision_end|>"
|
| 33 |
+
}
|
av-model/chat_template.jinja
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if is_system_content %}
|
| 10 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if do_vision_count %}
|
| 13 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- if add_vision_id %}
|
| 16 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 19 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 20 |
+
{%- if is_system_content %}
|
| 21 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- if do_vision_count %}
|
| 24 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- if add_vision_id %}
|
| 27 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 30 |
+
{%- elif 'text' in item %}
|
| 31 |
+
{{- item.text }}
|
| 32 |
+
{%- else %}
|
| 33 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endfor %}
|
| 36 |
+
{%- elif content is none or content is undefined %}
|
| 37 |
+
{{- '' }}
|
| 38 |
+
{%- else %}
|
| 39 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endmacro %}
|
| 42 |
+
{%- if not messages %}
|
| 43 |
+
{{- raise_exception('No messages provided.') }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 46 |
+
{{- '<|im_start|>system\n' }}
|
| 47 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 48 |
+
{%- for tool in tools %}
|
| 49 |
+
{{- "\n" }}
|
| 50 |
+
{{- tool | tojson }}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
{{- "\n</tools>" }}
|
| 53 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 54 |
+
{%- if messages[0].role == 'system' %}
|
| 55 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 56 |
+
{%- if content %}
|
| 57 |
+
{{- '\n\n' + content }}
|
| 58 |
+
{%- endif %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- '<|im_end|>\n' }}
|
| 61 |
+
{%- else %}
|
| 62 |
+
{%- if messages[0].role == 'system' %}
|
| 63 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 64 |
+
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 65 |
+
{%- endif %}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 68 |
+
{%- for message in messages[::-1] %}
|
| 69 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 70 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 71 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 72 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 73 |
+
{%- set ns.multi_step_tool = false %}
|
| 74 |
+
{%- set ns.last_query_index = index %}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{%- endif %}
|
| 77 |
+
{%- endfor %}
|
| 78 |
+
{%- if ns.multi_step_tool %}
|
| 79 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 80 |
+
{%- endif %}
|
| 81 |
+
{%- for message in messages %}
|
| 82 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 83 |
+
{%- if message.role == "system" %}
|
| 84 |
+
{%- if not loop.first %}
|
| 85 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 86 |
+
{%- endif %}
|
| 87 |
+
{%- elif message.role == "user" %}
|
| 88 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 89 |
+
{%- elif message.role == "assistant" %}
|
| 90 |
+
{%- set reasoning_content = '' %}
|
| 91 |
+
{%- if message.reasoning_content is string %}
|
| 92 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 93 |
+
{%- else %}
|
| 94 |
+
{%- if '</think>' in content %}
|
| 95 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 96 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{%- endif %}
|
| 99 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 100 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 101 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 102 |
+
{%- else %}
|
| 103 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 104 |
+
{%- endif %}
|
| 105 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 106 |
+
{%- for tool_call in message.tool_calls %}
|
| 107 |
+
{%- if tool_call.function is defined %}
|
| 108 |
+
{%- set tool_call = tool_call.function %}
|
| 109 |
+
{%- endif %}
|
| 110 |
+
{%- if loop.first %}
|
| 111 |
+
{%- if content|trim %}
|
| 112 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 113 |
+
{%- else %}
|
| 114 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 115 |
+
{%- endif %}
|
| 116 |
+
{%- else %}
|
| 117 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 118 |
+
{%- endif %}
|
| 119 |
+
{%- if tool_call.arguments is defined %}
|
| 120 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 121 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 122 |
+
{%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
|
| 123 |
+
{{- args_value }}
|
| 124 |
+
{{- '\n</parameter>\n' }}
|
| 125 |
+
{%- endfor %}
|
| 126 |
+
{%- endif %}
|
| 127 |
+
{{- '</function>\n</tool_call>' }}
|
| 128 |
+
{%- endfor %}
|
| 129 |
+
{%- endif %}
|
| 130 |
+
{{- '<|im_end|>\n' }}
|
| 131 |
+
{%- elif message.role == "tool" %}
|
| 132 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 133 |
+
{{- '<|im_start|>user' }}
|
| 134 |
+
{%- endif %}
|
| 135 |
+
{{- '\n<tool_response>\n' }}
|
| 136 |
+
{{- content }}
|
| 137 |
+
{{- '\n</tool_response>' }}
|
| 138 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 139 |
+
{{- '<|im_end|>\n' }}
|
| 140 |
+
{%- elif loop.last %}
|
| 141 |
+
{{- '<|im_end|>\n' }}
|
| 142 |
+
{%- endif %}
|
| 143 |
+
{%- else %}
|
| 144 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
{%- endfor %}
|
| 147 |
+
{%- if add_generation_prompt %}
|
| 148 |
+
{{- '<|im_start|>assistant\n' }}
|
| 149 |
+
{%- endif %}
|
av-model/config.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3_5ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"attn_output_gate": true,
|
| 8 |
+
"bos_token_id": null,
|
| 9 |
+
"dtype": "bfloat16",
|
| 10 |
+
"eos_token_id": 248044,
|
| 11 |
+
"full_attention_interval": 4,
|
| 12 |
+
"head_dim": 256,
|
| 13 |
+
"hidden_act": "silu",
|
| 14 |
+
"hidden_size": 4096,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 12288,
|
| 17 |
+
"layer_types": [
|
| 18 |
+
"linear_attention",
|
| 19 |
+
"linear_attention",
|
| 20 |
+
"linear_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"linear_attention",
|
| 23 |
+
"linear_attention",
|
| 24 |
+
"linear_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"linear_attention",
|
| 27 |
+
"linear_attention",
|
| 28 |
+
"linear_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"linear_attention",
|
| 31 |
+
"linear_attention",
|
| 32 |
+
"linear_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"linear_attention",
|
| 35 |
+
"linear_attention",
|
| 36 |
+
"linear_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"linear_attention",
|
| 39 |
+
"linear_attention",
|
| 40 |
+
"linear_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"linear_attention",
|
| 43 |
+
"linear_attention",
|
| 44 |
+
"linear_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"linear_attention",
|
| 47 |
+
"linear_attention",
|
| 48 |
+
"linear_attention",
|
| 49 |
+
"full_attention"
|
| 50 |
+
],
|
| 51 |
+
"linear_conv_kernel_dim": 4,
|
| 52 |
+
"linear_key_head_dim": 128,
|
| 53 |
+
"linear_num_key_heads": 16,
|
| 54 |
+
"linear_num_value_heads": 32,
|
| 55 |
+
"linear_value_head_dim": 128,
|
| 56 |
+
"mamba_ssm_dtype": "float32",
|
| 57 |
+
"max_position_embeddings": 262144,
|
| 58 |
+
"mlp_only_layers": [],
|
| 59 |
+
"model_type": "qwen3_5_text",
|
| 60 |
+
"mtp_num_hidden_layers": 1,
|
| 61 |
+
"mtp_use_dedicated_embeddings": false,
|
| 62 |
+
"num_attention_heads": 16,
|
| 63 |
+
"num_hidden_layers": 32,
|
| 64 |
+
"num_key_value_heads": 4,
|
| 65 |
+
"pad_token_id": null,
|
| 66 |
+
"partial_rotary_factor": 0.25,
|
| 67 |
+
"rms_norm_eps": 1e-06,
|
| 68 |
+
"rope_parameters": {
|
| 69 |
+
"mrope_interleaved": true,
|
| 70 |
+
"mrope_section": [
|
| 71 |
+
11,
|
| 72 |
+
11,
|
| 73 |
+
10
|
| 74 |
+
],
|
| 75 |
+
"partial_rotary_factor": 0.25,
|
| 76 |
+
"rope_theta": 10000000,
|
| 77 |
+
"rope_type": "default"
|
| 78 |
+
},
|
| 79 |
+
"tie_word_embeddings": false,
|
| 80 |
+
"transformers_version": "5.5.0",
|
| 81 |
+
"use_cache": true,
|
| 82 |
+
"vocab_size": 248320
|
| 83 |
+
}
|
av-model/generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": 248044,
|
| 4 |
+
"pad_token_id": 248044,
|
| 5 |
+
"transformers_version": "5.5.0",
|
| 6 |
+
"use_cache": true
|
| 7 |
+
}
|
av-model/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08b0e7bac759851198eaec0eafdd6afde7a375b87bcb0e9ecc3c1e25ca8ae765
|
| 3 |
+
size 17907663008
|
av-model/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
|
| 3 |
+
size 19989343
|
av-model/tokenizer_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"audio_bos_token": "<|audio_start|>",
|
| 4 |
+
"audio_eos_token": "<|audio_end|>",
|
| 5 |
+
"audio_token": "<|audio_pad|>",
|
| 6 |
+
"backend": "tokenizers",
|
| 7 |
+
"bos_token": null,
|
| 8 |
+
"clean_up_tokenization_spaces": false,
|
| 9 |
+
"eos_token": "<|im_end|>",
|
| 10 |
+
"errors": "replace",
|
| 11 |
+
"image_token": "<|image_pad|>",
|
| 12 |
+
"is_local": true,
|
| 13 |
+
"model_max_length": 262144,
|
| 14 |
+
"model_specific_special_tokens": {
|
| 15 |
+
"audio_bos_token": "<|audio_start|>",
|
| 16 |
+
"audio_eos_token": "<|audio_end|>",
|
| 17 |
+
"audio_token": "<|audio_pad|>",
|
| 18 |
+
"image_token": "<|image_pad|>",
|
| 19 |
+
"video_token": "<|video_pad|>",
|
| 20 |
+
"vision_bos_token": "<|vision_start|>",
|
| 21 |
+
"vision_eos_token": "<|vision_end|>"
|
| 22 |
+
},
|
| 23 |
+
"pad_token": "<|endoftext|>",
|
| 24 |
+
"padding_side": "left",
|
| 25 |
+
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 26 |
+
"processor_class": "Qwen3VLProcessor",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "TokenizersBackend",
|
| 29 |
+
"unk_token": null,
|
| 30 |
+
"video_token": "<|video_pad|>",
|
| 31 |
+
"vision_bos_token": "<|vision_start|>",
|
| 32 |
+
"vision_eos_token": "<|vision_end|>"
|
| 33 |
+
}
|
calibration/meta.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"layer": 18,
|
| 3 |
+
"activation_dim": 4096,
|
| 4 |
+
"normalize": "standardize",
|
| 5 |
+
"clamp_sigma": 8.0,
|
| 6 |
+
"num_examples": 120000,
|
| 7 |
+
"target_path": "SL-AI/GRaPE-2.1-Flash",
|
| 8 |
+
"context_window": 128,
|
| 9 |
+
"layers": [
|
| 10 |
+
18
|
| 11 |
+
]
|
| 12 |
+
}
|
calibration/stats.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:83bcb7cc63b10a06939376787d172dd048c084e4b5921ea08b91ea4707dfa5af
|
| 3 |
+
size 8475255
|
eval_report.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"config": "nla_config.json",
|
| 3 |
+
"checkpoint": "SL-AI/GRaPE-2.1-Flash-NLA",
|
| 4 |
+
"held_out_n": 80,
|
| 5 |
+
"fit_n": 100,
|
| 6 |
+
"best_of": 24,
|
| 7 |
+
"max_new_tokens": 50,
|
| 8 |
+
"random_retrieval": 0.0125,
|
| 9 |
+
"metric": "FVE (fraction of variance explained), cosine, retrieval@1",
|
| 10 |
+
"PRIMARY_AV_generative_roundtrip": {
|
| 11 |
+
"greedy_raw": {
|
| 12 |
+
"cos": 0.11685206741094589,
|
| 13 |
+
"retr@1": 0.26249998807907104,
|
| 14 |
+
"fve": -0.6114729642868042
|
| 15 |
+
},
|
| 16 |
+
"greedy_magcal": {
|
| 17 |
+
"cos": 0.11685206741094589,
|
| 18 |
+
"retr@1": 0.26249998807907104,
|
| 19 |
+
"fve": -0.002733588218688965
|
| 20 |
+
},
|
| 21 |
+
"bestofK_raw": {
|
| 22 |
+
"cos": 0.2748314440250397,
|
| 23 |
+
"retr@1": 0.75,
|
| 24 |
+
"fve": -0.312843918800354
|
| 25 |
+
},
|
| 26 |
+
"bestofK_magcal": {
|
| 27 |
+
"cos": 0.2748314440250397,
|
| 28 |
+
"retr@1": 0.75,
|
| 29 |
+
"fve": 0.026947617530822754
|
| 30 |
+
},
|
| 31 |
+
"bestofK_perdim_cal": {
|
| 32 |
+
"cos": 0.15629741549491882,
|
| 33 |
+
"retr@1": 0.5,
|
| 34 |
+
"fve": 0.0061414241790771484
|
| 35 |
+
},
|
| 36 |
+
"note": "activation -> generated text -> activation; the real 'thought from a hidden state'"
|
| 37 |
+
},
|
| 38 |
+
"SECONDARY_given_text_reconstruction": {
|
| 39 |
+
"raw": {
|
| 40 |
+
"cos": 0.9040088653564453,
|
| 41 |
+
"retr@1": 0.987500011920929,
|
| 42 |
+
"fve": 0.814344048500061
|
| 43 |
+
},
|
| 44 |
+
"perdim_cal": {
|
| 45 |
+
"cos": 0.9016216993331909,
|
| 46 |
+
"retr@1": 0.987500011920929,
|
| 47 |
+
"fve": 0.8100962042808533
|
| 48 |
+
},
|
| 49 |
+
"note": "AR text->activation; presupposes the text, NOT a generated thought"
|
| 50 |
+
},
|
| 51 |
+
"distinct_readings": "78/80",
|
| 52 |
+
"coherent_fraction": 1.0,
|
| 53 |
+
"on_topic_jaccard": {
|
| 54 |
+
"own": 0.18751889010740513,
|
| 55 |
+
"random": 0.048980255730286325,
|
| 56 |
+
"ratio": 3.8284587802071273
|
| 57 |
+
},
|
| 58 |
+
"avg_reading_words": 26.7,
|
| 59 |
+
"sample_readings_by_cosine": [
|
| 60 |
+
{
|
| 61 |
+
"cosine": 0.956,
|
| 62 |
+
"reading": "Sure! My phone number is 555-123-2002, and my name is John Smith."
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
"cosine": 0.332,
|
| 66 |
+
"reading": "Alright, I checked the top of my screen. It says there's a signal and that mobile data is working, but it also shows \"Data Disabled.\" Right now I see airplane mode isn't on, so hopefully things are ok"
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"cosine": 0.245,
|
| 70 |
+
"reading": "How have specific environmental factors contributed to the evolution of unique species assemblages in tropical ecosystems?"
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"cosine": 0.195,
|
| 74 |
+
"reading": "A 62.2 kg object is pushed with a force of 83.2 N at an angle of 41.5 degrees to the horizontal. Calculate the acceleration and net work done on it if it moves through a distance of"
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"cosine": 0.003,
|
| 78 |
+
"reading": "Compute (74856 * 392) mod 10. Show each step."
|
| 79 |
+
}
|
| 80 |
+
]
|
| 81 |
+
}
|
nla_config.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"target_path": "./av-model",
|
| 3 |
+
"nla_dir": ".",
|
| 4 |
+
"backbone": {
|
| 5 |
+
"path": "./av-model",
|
| 6 |
+
"quantization": "nf4",
|
| 7 |
+
"compute_dtype": "bfloat16",
|
| 8 |
+
"double_quant": true,
|
| 9 |
+
"device_map": "auto",
|
| 10 |
+
"trust_remote_code": true,
|
| 11 |
+
"attn_implementation": "eager"
|
| 12 |
+
},
|
| 13 |
+
"surgery": {
|
| 14 |
+
"av_lora_rank": 48,
|
| 15 |
+
"av_lora_alpha": 96,
|
| 16 |
+
"av_lora_dropout": 0.0,
|
| 17 |
+
"av_num_slots": 8,
|
| 18 |
+
"av_proj_hidden": 3072,
|
| 19 |
+
"ar_lora_rank": 128,
|
| 20 |
+
"ar_lora_alpha": 256,
|
| 21 |
+
"ar_lora_dropout": 0.0,
|
| 22 |
+
"ar_head_hidden": 4096,
|
| 23 |
+
"ar_unfreeze_output_proj": false,
|
| 24 |
+
"lora_target_modules": [
|
| 25 |
+
"q_proj",
|
| 26 |
+
"k_proj",
|
| 27 |
+
"v_proj",
|
| 28 |
+
"o_proj",
|
| 29 |
+
"gate_proj",
|
| 30 |
+
"up_proj",
|
| 31 |
+
"down_proj",
|
| 32 |
+
"in_proj_qkv",
|
| 33 |
+
"out_proj"
|
| 34 |
+
]
|
| 35 |
+
},
|
| 36 |
+
"activation": {
|
| 37 |
+
"layer": 18,
|
| 38 |
+
"layers": [
|
| 39 |
+
18
|
| 40 |
+
],
|
| 41 |
+
"normalize": "standardize",
|
| 42 |
+
"clamp_sigma": 8.0,
|
| 43 |
+
"pca_dim": 512
|
| 44 |
+
},
|
| 45 |
+
"extract": {
|
| 46 |
+
"out_dir": "./calibration",
|
| 47 |
+
"num_examples": 120000,
|
| 48 |
+
"max_seq_len": 128,
|
| 49 |
+
"positions_per_context": 5,
|
| 50 |
+
"skip_first": 4,
|
| 51 |
+
"batch_size": 6,
|
| 52 |
+
"context_window": 128,
|
| 53 |
+
"corpus_max_texts": 80000,
|
| 54 |
+
"corpus_max_chars": 600,
|
| 55 |
+
"corpus_min_chars": 24,
|
| 56 |
+
"corpus_include_thinking": true,
|
| 57 |
+
"corpus_include_prompts": true,
|
| 58 |
+
"corpus_seed": 0,
|
| 59 |
+
"corpus_english_only": true
|
| 60 |
+
},
|
| 61 |
+
"train": {
|
| 62 |
+
"out_dir": "./run",
|
| 63 |
+
"dataset_dir": "./calibration",
|
| 64 |
+
"epochs": 2,
|
| 65 |
+
"max_steps": 3500,
|
| 66 |
+
"batch_size": 2,
|
| 67 |
+
"grad_accum": 8,
|
| 68 |
+
"lr": 0.0003,
|
| 69 |
+
"weight_decay": 0.0,
|
| 70 |
+
"warmup_ratio": 0.03,
|
| 71 |
+
"max_grad_norm": 1.0,
|
| 72 |
+
"max_explanation_tokens": 50,
|
| 73 |
+
"min_explanation_tokens": 12,
|
| 74 |
+
"w_cosine": 0.0,
|
| 75 |
+
"w_mse": 0.0,
|
| 76 |
+
"w_ar_teacher": 1.0,
|
| 77 |
+
"ar_short_frac": 0.0,
|
| 78 |
+
"w_distill": 0.5,
|
| 79 |
+
"w_distill_final": 0.2,
|
| 80 |
+
"distill_anneal_frac": 0.4,
|
| 81 |
+
"w_recon_reward": 0.0,
|
| 82 |
+
"grad_decode": false,
|
| 83 |
+
"gumbel_tau": 1.0,
|
| 84 |
+
"grad_checkpointing": true,
|
| 85 |
+
"optim_8bit": true,
|
| 86 |
+
"save_every": 350,
|
| 87 |
+
"eval_every": 350,
|
| 88 |
+
"log_every": 25,
|
| 89 |
+
"eval_examples": 64,
|
| 90 |
+
"seed": 0,
|
| 91 |
+
"resume": true,
|
| 92 |
+
"teacher_path": null,
|
| 93 |
+
"max_distill_tokens": 24,
|
| 94 |
+
"rl_max_new_tokens": 32,
|
| 95 |
+
"rl_lr": 2e-05,
|
| 96 |
+
"rl_entropy_coef": 0.02,
|
| 97 |
+
"w_ar_coadapt": 0.0
|
| 98 |
+
}
|
| 99 |
+
}
|
ood_report.json
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"config": "nla_config.json",
|
| 3 |
+
"checkpoint": "SL-AI/GRaPE-2.1-Flash-NLA",
|
| 4 |
+
"n_ood_prompts": 24,
|
| 5 |
+
"best_of": 24,
|
| 6 |
+
"layer": 18,
|
| 7 |
+
"random_retrieval": 0.041666666666666664,
|
| 8 |
+
"note": "prompts are hand-written from domains far outside the sampled corpus",
|
| 9 |
+
"AV_generative_roundtrip": {
|
| 10 |
+
"cos": 0.69648677110672,
|
| 11 |
+
"retr@1": 0.4583333432674408,
|
| 12 |
+
"fve": -0.006114959716796875
|
| 13 |
+
},
|
| 14 |
+
"AV_generative_roundtrip_magcal": {
|
| 15 |
+
"cos": 0.69648677110672,
|
| 16 |
+
"retr@1": 0.4583333432674408,
|
| 17 |
+
"fve": 0.11318624019622803
|
| 18 |
+
},
|
| 19 |
+
"AR_given_text_reconstruction": {
|
| 20 |
+
"cos": 0.8898084163665771,
|
| 21 |
+
"retr@1": 1.0,
|
| 22 |
+
"fve": 0.6475629806518555
|
| 23 |
+
},
|
| 24 |
+
"english_ok_fraction": 1.0,
|
| 25 |
+
"readings": [
|
| 26 |
+
{
|
| 27 |
+
"reading": "Write the full Hamiltonian for a topological insulator with Dirac surface fermions.",
|
| 28 |
+
"recon_cos": 0.796,
|
| 29 |
+
"english_fraction": 0.917,
|
| 30 |
+
"has_nonascii_letter": false
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"reading": "How does DNA methylation regulate plant development during the WUSCH pathway?",
|
| 34 |
+
"recon_cos": 0.696,
|
| 35 |
+
"english_fraction": 0.818,
|
| 36 |
+
"has_nonascii_letter": false
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"reading": "Explain the four Dorsal vertae groups and their role in classification.",
|
| 40 |
+
"recon_cos": 0.578,
|
| 41 |
+
"english_fraction": 0.909,
|
| 42 |
+
"has_nonascii_letter": false
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"reading": "What distinguishes a meso compound from other stereoisomers?",
|
| 46 |
+
"recon_cos": 0.882,
|
| 47 |
+
"english_fraction": 0.75,
|
| 48 |
+
"has_nonascii_letter": false
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"reading": "Prove that \\( S_5 \\) is not simple.",
|
| 52 |
+
"recon_cos": 0.79,
|
| 53 |
+
"english_fraction": 1.0,
|
| 54 |
+
"has_nonascii_letter": false
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"reading": "Describe cosmic fullness in the style of a dharmic deity.",
|
| 58 |
+
"recon_cos": 0.567,
|
| 59 |
+
"english_fraction": 0.9,
|
| 60 |
+
"has_nonascii_letter": false
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"reading": "Write a 50-word haiku sequence (14 lines) about technology, using only present and past tenses.",
|
| 64 |
+
"recon_cos": 0.666,
|
| 65 |
+
"english_fraction": 1.0,
|
| 66 |
+
"has_nonascii_letter": false
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"reading": "How does the chaotic behavior of fluid flow impact bioremediation processes in contaminated environments?",
|
| 70 |
+
"recon_cos": 0.452,
|
| 71 |
+
"english_fraction": 0.929,
|
| 72 |
+
"has_nonascii_letter": false
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"reading": "Analyze the relationship between limb movements and muscle activation patterns during a specific dance sequence.",
|
| 76 |
+
"recon_cos": 0.726,
|
| 77 |
+
"english_fraction": 1.0,
|
| 78 |
+
"has_nonascii_letter": false
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"reading": "How does the structure of long bones contribute to their function in leverage?",
|
| 82 |
+
"recon_cos": 0.775,
|
| 83 |
+
"english_fraction": 1.0,
|
| 84 |
+
"has_nonascii_letter": false
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"reading": "What is the name of a major constituent (90%+) found in archaeological sites from 1453 BC?",
|
| 88 |
+
"recon_cos": 0.425,
|
| 89 |
+
"english_fraction": 1.0,
|
| 90 |
+
"has_nonascii_letter": false
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"reading": "Describe the coalescence process of two black holes and its gravitational wave signature.",
|
| 94 |
+
"recon_cos": 0.673,
|
| 95 |
+
"english_fraction": 1.0,
|
| 96 |
+
"has_nonascii_letter": false
|
| 97 |
+
},
|
| 98 |
+
{
|
| 99 |
+
"reading": "How does the Joseph junction in a superconducting circuit produce single-photon interference?",
|
| 100 |
+
"recon_cos": 0.682,
|
| 101 |
+
"english_fraction": 0.923,
|
| 102 |
+
"has_nonascii_letter": false
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"reading": "Write a 50-word poem from the perspective of an exploding cookie.",
|
| 106 |
+
"recon_cos": 0.787,
|
| 107 |
+
"english_fraction": 1.0,
|
| 108 |
+
"has_nonascii_letter": false
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"reading": "What is the historical significance of the Treaty at Nijmeduin in 1478?",
|
| 112 |
+
"recon_cos": 0.813,
|
| 113 |
+
"english_fraction": 0.909,
|
| 114 |
+
"has_nonascii_letter": false
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"reading": "Explain the event horizon paradox and how it relates to black hole thermodynamics.",
|
| 118 |
+
"recon_cos": 0.78,
|
| 119 |
+
"english_fraction": 1.0,
|
| 120 |
+
"has_nonascii_letter": false
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
"reading": "What processes have shaped the morphological evolution of horse teeth?",
|
| 124 |
+
"recon_cos": 0.64,
|
| 125 |
+
"english_fraction": 1.0,
|
| 126 |
+
"has_nonascii_letter": false
|
| 127 |
+
},
|
| 128 |
+
{
|
| 129 |
+
"reading": "How does the Munc13-4 calcium-dependent exocytosis protein contribute to presynaptic vesicle fusion?",
|
| 130 |
+
"recon_cos": 0.783,
|
| 131 |
+
"english_fraction": 0.769,
|
| 132 |
+
"has_nonascii_letter": false
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"reading": "Implement a test for the Miller-Rabin primality theorem. Explain how it works and why it's important.",
|
| 136 |
+
"recon_cos": 0.63,
|
| 137 |
+
"english_fraction": 0.941,
|
| 138 |
+
"has_nonascii_letter": false
|
| 139 |
+
},
|
| 140 |
+
{
|
| 141 |
+
"reading": "Analyze the structural paradox in Shakespeare's Hamlet: how does its greatest strength also cause its tragic flaw?",
|
| 142 |
+
"recon_cos": 0.584,
|
| 143 |
+
"english_fraction": 1.0,
|
| 144 |
+
"has_nonascii_letter": false
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"reading": "What is the strong coupling constant of quarks and how does it vary with energy?",
|
| 148 |
+
"recon_cos": 0.778,
|
| 149 |
+
"english_fraction": 1.0,
|
| 150 |
+
"has_nonascii_letter": false
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"reading": "What are the cultural and historical significance of Newgrange in Ireland?",
|
| 154 |
+
"recon_cos": 0.707,
|
| 155 |
+
"english_fraction": 0.909,
|
| 156 |
+
"has_nonascii_letter": false
|
| 157 |
+
},
|
| 158 |
+
{
|
| 159 |
+
"reading": "How does the curvature of spacetime around a massive object cause light to follow an orbit?",
|
| 160 |
+
"recon_cos": 0.748,
|
| 161 |
+
"english_fraction": 0.938,
|
| 162 |
+
"has_nonascii_letter": false
|
| 163 |
+
},
|
| 164 |
+
{
|
| 165 |
+
"reading": "Write a Ruby program that generates the Fibonacci sequence.",
|
| 166 |
+
"recon_cos": 0.758,
|
| 167 |
+
"english_fraction": 1.0,
|
| 168 |
+
"has_nonascii_letter": false
|
| 169 |
+
}
|
| 170 |
+
]
|
| 171 |
+
}
|
surgery_heads.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce49e28ae32c6cf365d6d79f8cdd016830aa0f44aa962dc6bc5c7b6c5b9219d1
|
| 3 |
+
size 275971581
|
upload_to_hf.sh
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Publish the full merged NLA models to the HuggingFace Hub.
|
| 3 |
+
# huggingface-cli login # once, with a write token
|
| 4 |
+
# ./upload_to_hf.sh
|
| 5 |
+
set -euo pipefail
|
| 6 |
+
REPO="${1:-SL-AI/GRaPE-2.1-Flash-NLA}"
|
| 7 |
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
| 8 |
+
echo "Uploading $HERE -> https://huggingface.co/$REPO"
|
| 9 |
+
huggingface-cli upload "$REPO" "$HERE" . --repo-type=model \
|
| 10 |
+
--commit-message="Publish GRaPE-2.1-Flash NLA: full merged AV+AR models (English-only reader)"
|
| 11 |
+
echo "Done -> https://huggingface.co/$REPO"
|