diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..44edde7c32619b6687a07a0dbe3ce4cdba78538a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,16 @@ saved_model/**/* 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 +*.axmodel filter=lfs diff=lfs merge=lfs -text +main_api_ax650 filter=lfs diff=lfs merge=lfs -text +main_api_axcl_x86 filter=lfs diff=lfs merge=lfs -text +main_ax650 filter=lfs diff=lfs merge=lfs -text +main_axcl_x86 filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.mp4 filter=lfs diff=lfs merge=lfs -text +*.mp3 filter=lfs diff=lfs merge=lfs -text +*.wav filter=lfs diff=lfs merge=lfs -text +tokenizer.json filter=lfs diff=lfs merge=lfs -text +gemma4_tokenizer.txt filter=lfs diff=lfs merge=lfs -text +bin/axllm filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md index 555b4aed7fba6658868d69c9844d1dcb224a0d31..10af71150acc49ba4d6ac3991c812ec416fcf026 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,499 @@ --- -license: bsd-3-clause +library_name: transformers +license: gemma +base_model: + - google/gemma-4-E4B-it +pipeline_tag: image-text-to-text +tags: + - gemma4 + - multimodal + - vision + - video + - audio + - axera + - ax650 + - npu + - quantized + - gptq + - 4-bit + - W4A16 + - long-context +language: + - en + - multilingual --- + +

+ Gemma4-Axera Banner +

+ +# Gemma 4 E4B GPTQ-INT4 8K-Context on AXERA NPU + +Ready-to-run deployment package for the GPTQ INT4 (W4A16) conversion of +[`google/gemma-4-E4B-it`](https://huggingface.co/google/gemma-4-E4B-it) on AX650 / NPU3, +compiled for an extended 8K-token context. + +- Runtime: packaged `axllm` OpenAI-compatible server +- Target: AX650 / AX650N, AArch64 +- Core context layout: 256-token prefill chunk, 6400-token max prefill, 8191-token decode context +- Packaged modalities: text, single image, video, fixed-duration audio +- Included runtime assets: `bin/axllm`, 43 text axmodel files, 3 vision axmodel files, + 2 audio axmodel files, tokenizer, embedding weights, sample assets + +The text runtime extends the context window to 8191 tokens with up to 6400 tokens of prefill +capacity, using 25 warm-prefill history buckets (256 to 6144 in 256-token steps). The model has 42 +transformer layers with sliding/full attention (512-token sliding window, full attention every 6th +layer) and 18 KV-shared layers. + +## Supported Platform + +- AX650 / AX650N +- NPU3 runtime environment +- 10 GiB CMM configuration required + +## Compiled Runtime Profile + +| Setting | Value | +| --- | ---: | +| Transformer layers | 42 | +| Prefill graph length | 256 tokens | +| Warm-prefill history buckets | 256 to 6144 tokens, in 256-token steps | +| Number of prefill groups | 25 | +| Maximum compiled prefill capacity | 6400 tokens | +| Maximum KV-cache length | 8191 tokens | +| Sliding-attention window | 512 tokens | +| Full-attention layers | 7 (every 6th layer) | +| KV-shared layers | 18 | +| Text quantization | W4A16 GPTQ (AutoRound), group size 128 | +| Post stage | INT8 (s8) weights | +| Vision / audio encoder quantization | U16 activations, FP32 conv bias | +| Hidden-state interface | BF16 | +| Validated server concurrency | 1 request | + +## Text Performance + +Measured on AX650 with the packaged runtime, one request at a time, greedy decoding +(`temperature=0`). TTFT means time to first token. + +| Prompt tokens | Prefill chunks | TTFT (s) | Decode (tok/s) | +| ---: | ---: | ---: | ---: | +| 497 | 2 | 4.2 | 3.3 | +| 1009 | 4 | 8.6 | 3.3 | +| 2033 | 8 | 14.9 | 3.3 | +| 4081 | 16 | 37.1 | 3.0 | +| 5105 | 20 | 53.6 | 2.9 | +| 6129 | 24 | 70.7 | 3.1 | + +Decode holds at roughly 2.9 to 3.4 tok/s and does not degrade as the KV cache fills. + +TTFT also depends on the prompt's content, not only its length: repeated wording is cheaper than +highly varied text, and follow-up requests that reuse earlier wording are cheaper again. The table +above is the slower end of that range. Image, video and audio tokens always pay full price, so a +30 s audio clip adds 750 tokens at full cost. + +## Runtime Footprint + +CMM and Linux OS memory are separate pools on AX650. The values below were measured with the +packaged server fully loaded on an otherwise idle board. + +| Item | Measured value | +| --- | ---: | +| CMM used, text runtime only | 6955 MiB | +| CMM used, text + `t70` vision encoder | 7126 MiB | +| CMM used, text + `t70` vision + both audio encoders (packaged default) | 7778 MiB | +| CMM remaining at the packaged default | 2461 MiB | +| OS RSS after init | 946 MiB | +| OS RSS at peak (during 6k-token request) | 1132 MiB | + +CMM does not grow during inference. The KV cache is pre-allocated at initialization for the full +8191-token context. Weights are memory-mapped (`mmap`) into page cache rather than anonymous +memory, so the OS resident cost is small. + +Only one vision encoder is loaded at a time, selected by `filename_image_encoder_axmodel` in +`config.json`; both audio encoders are loaded when both files are present. Switching the vision +profile to `t140` or `t280` adds roughly 19 MiB or 126 MiB over the `t70` default. This package +cannot be loaded alongside another multi-GB model on a 10 GiB CMM device. + +## Vision Encoder + +Three fixed-resolution vision encoders are packaged. Each is a fixed shape: the resolution and the +soft-token count are compiled in and are not user-configurable at runtime. Soft tokens are the +number of image embeddings inserted into the text sequence, equal to +`(height / patch_size) * (width / patch_size) / 9` with `patch_size = 16` and 3x3 pooling. + +| Model | Resolution | Soft tokens | Encoder latency | Encoder CMM | +| --- | --- | ---: | ---: | ---: | +| `gemma4_vision_h336_w480_t70.axmodel` | 336x480 | 70 | 87.4 ms | 180.9 MiB | +| `gemma4_vision_h480_w672_t140.axmodel` | 480x672 | 140 | 256.6 ms | 199.4 MiB | +| `gemma4_vision_h672_w960_t280.axmodel` | 672x960 | 280 | 744.3 ms | 306.4 MiB | + +Latency is a single-model average from `ax_run_model -w 1 -r 5` on AX650, excluding text prefill +and decode. The package default is the `t70` profile. To switch profiles, edit `config.json`: + +```json +{ + "filename_image_encoder_axmodel": "gemma4_vision_h480_w672_t140.axmodel", + "vision_width": 672, + "vision_height": 480 +} +``` + +Change the resolution pair together with the encoder file. A mismatch makes the runtime preprocess +images to a shape the encoder was not compiled for. + +The runtime caches image embeddings under `vision_cache/` keyed by the media path. Delete that +directory after switching profiles, otherwise an entry produced by the previous encoder is reused. + +Both the vision and the audio encoders are converted from the unquantized upstream weights, because +the source INT4 checkpoint leaves both encoder towers in full precision. + +Higher profiles resolve finer detail at a higher latency cost. Use `t70` for the fastest response +and `t140` or `t280` when small features such as text in the image matter. + +## Audio Encoder + +Two fixed-duration audio encoders are packaged. The duration is compiled in, and `axllm` selects +the profile from the clip length. Audio longer than 30 s is truncated to the 30 s window. + +| Model | Audio duration | Mel frames | Audio tokens | Encoder latency | Encoder CMM | +| --- | --- | ---: | ---: | ---: | ---: | +| `gemma4_audio_5s.axmodel` | 5 s | 499 | 125 | 29.5 ms | 335.7 MiB | +| `gemma4_audio_30s.axmodel` | 30 s | 2999 | 750 | 173.1 ms | 360.5 MiB | + +Latency is a single-model average from `ax_run_model -w 1 -r 5` on AX650, excluding text prefill +and decode. Both encoders are loaded at startup when both files are present. + +### Audio Input Format + +Gemma 4's audio front end is defined at **16 kHz mono** (`sampling_rate: 16000` in +`gemma_4_e4b_it_tokenizer/processor_config.json`). Supply audio at that rate and the runtime feeds it straight to the mel +front end. Any other rate is resampled on the CPU first, and that resampling — not the NPU encoder — +dominates the time before the first token. Measured on AX650 for a 30 s clip: + +| Input | Feature extraction (read + resample + mel) | NPU encode | +| --- | ---: | ---: | +| 16 kHz mono (native) | 0.94 s | 0.18 s | +| 48 kHz stereo | 2.6 s | 0.18 s | +| 44.1 kHz stereo | 3.0 s | 0.18 s | + +Convert once before sending, for example: + +```bash +ffmpeg -i input.wav -ar 16000 -ac 1 -c:a pcm_s16le input_16k.wav +``` + +The packaged sample clips are already 16 kHz mono. + +**WAV only.** The audio path accepts uncompressed `RIFF/WAVE` PCM. Compressed containers are +rejected with `unsupported wav container (expect RIFF/WAVE)`, even when `ffmpeg` is installed on the +board, so decode `mp3 / flac / m4a / ogg` to 16 kHz mono WAV first with the command above. + +A 30 s clip's 750 audio tokens span several prefill chunks, so attention within the audio block is +not fully bidirectional across chunk boundaries. + +## Video + +Video is handled by the same vision encoder, one frame at a time, using the frame count in +`gemma_4_e4b_it_tokenizer/processor_config.json` (`num_frames: 32`). At the default `t70` profile that is +32 x 70 = 2240 soft tokens per clip, so a video request costs about 2360 input tokens including the +text part and uses 10 prefill chunks. + +Only the picture is used. A video's audio track is ignored; audio is a separate input, so send it as +its own `audio_url` part if you need both. + +## Package Layout + +```text +. +├── README.md +├── bin/axllm +├── serve.sh +├── config.json +├── post_config.json +├── gemma4_tokenizer.txt +├── assets/ +│ ├── gemma4_axera_banner.jpg +│ ├── sample.png +│ ├── red-panda-openai.mp4 +│ ├── gemma4_audio_test_5s.wav +│ ├── gemma4_audio_test_chunk0_30s.wav +│ └── gemma4_audio_test_chunk1_30s.wav +├── gemma4_text_p256_l0_together.axmodel ... gemma4_text_p256_l41_together.axmodel +├── gemma4_text_post.axmodel +├── gemma4_vision_h336_w480_t70.axmodel +├── gemma4_vision_h480_w672_t140.axmodel +├── gemma4_vision_h672_w960_t280.axmodel +├── gemma4_audio_5s.axmodel +├── gemma4_audio_30s.axmodel +├── model.embed_tokens.weight.bfloat16.bin +├── model.embed_tokens_per_layer.weight.npy +├── model.per_layer_model_projection.weight.npy +├── model.per_layer_projection_norm.weight.npy +└── gemma_4_e4b_it_tokenizer/ + ├── config.json + ├── tokenizer.json + ├── tokenizer_config.json + ├── generation_config.json + ├── processor_config.json + └── chat_template.jinja +``` + +The root directory is the direct `axllm` runtime layout: all axmodel files, the embedding weights, +and the tokenizer text file live at the root. The tokenizer subdirectory holds the Hugging Face +tokenizer and model metadata without source weight shards. + +## Sample Assets + +The package ships the media used in the examples below. + +`assets/sample.png` + +![sample](assets/sample.png) + +Three WAV clips of English speech at 16 kHz mono, one per audio profile length: + +- `assets/gemma4_audio_test_5s.wav` (5.00 s) +- `assets/gemma4_audio_test_chunk0_30s.wav` (30.00 s) +- `assets/gemma4_audio_test_chunk1_30s.wav` (30.00 s) + +One video clip for the video example: + +- `assets/red-panda-openai.mp4` (30.1 s, 360x640) + +## Download + +```bash +mkdir -p AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K +cd AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K +hf download AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K --local-dir . +``` + +## Packaged Runtime + +The package ships a prebuilt AArch64 `bin/axllm`, so no separate install step is needed, and the +figures in this README refer to that binary. Replacing it with a different build of +[`AXERA-TECH/ax-llm`](https://github.com/AXERA-TECH/ax-llm) may change the TTFT figures. + +## Run on the Board + +From the package root: + +```bash +chmod +x ./bin/axllm ./serve.sh +./serve.sh --port 8000 +``` + +Or equivalently: + +```bash +chmod +x ./bin/axllm +./bin/axllm serve . --port 8000 +``` + +Check service health and the loaded model: + +```bash +curl http://127.0.0.1:8000/health +curl http://127.0.0.1:8000/v1/models +``` + +The health endpoint returns `"status": "healthy"`, and the model list contains +`AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K`. + +**Server timeout:** the default `--server_timeout_ms` is 300 seconds, which covers a 6000-token +prompt (about 71 s of TTFT) plus a few hundred output tokens. A long prompt combined with a long +generation can still exceed it, since decode runs at roughly 3 tok/s. Raise it when you need both, +and raise the client-side HTTP timeout to match: + +```bash +./serve.sh --port 8000 --server_timeout_ms 600000 +``` + +## Text Request + +```bash +curl http://127.0.0.1:8000/v1/chat/completions \ + -H 'Content-Type: application/json' \ + -d '{ + "model": "AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K", + "messages": [ + {"role": "user", "content": "What is the capital of France?"} + ], + "max_tokens": 64, + "temperature": 0, + "stream": false + }' +``` + +Measured response: + +```text +The capital of France is **Paris**. +``` + +## Image Request + +Pass the image as a board-side file path or as a base64 `data:` URI. + +```bash +curl http://127.0.0.1:8000/v1/chat/completions \ + -H 'Content-Type: application/json' \ + -d '{ + "model": "AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K", + "messages": [ + {"role": "user", "content": [ + {"type": "image_url", "image_url": {"url": "./assets/sample.png"}}, + {"type": "text", "text": "What animal is in this image and what colour is it? Answer in one sentence."} + ]} + ], + "max_tokens": 96, + "temperature": 0, + "stream": false + }' +``` + +Measured response with the default `t70` profile: + +```text +The animal in the image is a red lobster. +``` + +One image per message is supported. Mixing image and audio in the same message is not supported. + +## Audio Request + +Pass the audio as a board-side file path or as a base64 `data:` URI. The clip length selects the +encoder profile. + +```bash +curl http://127.0.0.1:8000/v1/chat/completions \ + -H 'Content-Type: application/json' \ + -d '{ + "model": "AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K", + "messages": [ + {"role": "user", "content": [ + {"type": "audio_url", "audio_url": {"url": "./assets/gemma4_audio_test_5s.wav"}}, + {"type": "text", "text": "Transcribe the speech in this audio in its original language. Output only the transcription."} + ]} + ], + "max_tokens": 128, + "temperature": 0, + "stream": false + }' +``` + +Measured response for `assets/gemma4_audio_test_5s.wav` (5 s profile, 125 audio tokens): + +```text +When I was seventeen, I read a quote that went something like, if you +``` + +Measured response for `assets/gemma4_audio_test_chunk0_30s.wav` (30 s profile, 750 audio tokens): + +```text +No one wants to die. Even people who want to go to heaven don't want to die to get there. And yet, +death is the destination we all share. No one has ever escaped it, and that is as it should be +because death is very likely the single best invention of life. It's life's change agent. It clears +out the old to make way for the new. Right now, the new is you. But someday, not too long from now, +you will gradually become +``` + +End to end on AX650 with the packaged clips this takes about 9 s for the 5 s clip and 34 to 44 s for +a 30 s clip, almost all of it text decode rather than audio processing. Both transcriptions above +stop at the `max_tokens` limit, not at a sentence boundary. + +One audio file per message is supported. Mixing audio and image in the same message is not +supported. + +## Video Request + +```bash +curl http://127.0.0.1:8000/v1/chat/completions \ + -H 'Content-Type: application/json' \ + -d '{ + "model": "AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K", + "messages": [ + {"role": "user", "content": [ + {"type": "video_url", "video_url": {"url": "./assets/red-panda-openai.mp4"}}, + {"type": "text", "text": "What animal is in this video? Answer with the animal name only."} + ]} + ], + "max_tokens": 48, + "temperature": 0, + "stream": false + }' +``` + +Measured response for the packaged 30 s clip at the default `t70` profile: + +```text +Red Panda +``` + +A video request of this length costs about 2360 input tokens and takes roughly 40 s end to end. + +## Multi-turn Conversation + +Send the whole message list each turn, as an OpenAI client normally does. The runtime keeps the KV +cache from the previous turns and only processes the new tokens, so follow-up turns are far cheaper +than the first. With a 3223-token document in the opening message, the first turn takes about 22 s to +the first token and each short follow-up about 3 s, with the earlier turns still available to the +model. + +## Context Limits + +| Limit | Value | Behaviour | +| --- | ---: | --- | +| Input tokens per request | 6400 | Above it the server returns HTTP 400 with `input_num_token(N) > prefill_max_token_num(6400)` | +| Total context (prompt + generation + history) | 8191 | KV cache is pre-allocated for this at startup | + +A request over the 6400-token cap is rejected outright rather than silently truncated, so keep +prompts within the cap. + +## Transcription Endpoint + +The OpenAI-compatible `/v1/audio/transcriptions` and `/v1/audio/translations` endpoints are also +available. They take a multipart upload, so the audio file does not have to exist on the board, and +they work with any OpenAI-compatible client or web UI without extra parameters. + +```bash +curl http://127.0.0.1:8000/v1/audio/transcriptions \ + -F model=AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K \ + -F file=@./assets/gemma4_audio_test_5s.wav +``` +Measured response: + +```json +{ + "text": "When I was seventeen, I read a quote that went something like, if you" +} +``` + +The 30 s clips select the 750-token encoder through the same endpoint. Measured response for +`assets/gemma4_audio_test_chunk0_30s.wav`: + +```json +{ + "text": "No one wants to die. Even people who want to go to heaven don't want to die to get there. And yet, death is the destination we all share. No one has ever escaped it, and that is as it should be because death is very likely the single best invention of life. It's life's change agent. It clears out the old to make way for the new. Right now, the new is you. But someday, not too long from now, you will gradually become" +} +``` + +`response_format` accepts `json` (default), `verbose_json`, `text`, `srt` and `vtt`. The response is +always wrapped as `{"text": ...}`; `srt` and `vtt` put the same text in a single subtitle cue +spanning the whole clip, so there is no word-level or segment-level timing. + +`/v1/audio/translations` follows the OpenAI definition and translates into English. With the packaged +English clips its output is the same as the transcription. + +## Conversion References + +If you need the original model files or want to rebuild the deployment artifacts, start with: + +- Original Hugging Face model: [`google/gemma-4-E4B-it`](https://huggingface.co/google/gemma-4-E4B-it) +- Source INT4 checkpoint for the text weights: [`Vishva007/gemma-4-E4B-it-W4A16-AutoRound-GPTQ`](https://huggingface.co/Vishva007/gemma-4-E4B-it-W4A16-AutoRound-GPTQ) +- AXERA conversion and deployment workflow: [`AXERA-TECH/gemma-4-E2B-it.axera`](https://github.com/AXERA-TECH/gemma-4-E2B-it.axera) + +## Discussion + +- [GitHub Issues](https://github.com/AXERA-TECH/ax-llm/issues) +- QQ group: `139953715` diff --git a/assets/gemma4_audio_test_5s.wav b/assets/gemma4_audio_test_5s.wav new file mode 100644 index 0000000000000000000000000000000000000000..65f6454472c3918a30891b5d3ef7a17e1b07bea8 --- /dev/null +++ b/assets/gemma4_audio_test_5s.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9452e13af6d8a754f7e6fae143f232cff88b0e4467a21f3c48f6e624fee9f191 +size 160294 diff --git a/assets/gemma4_audio_test_chunk0_30s.wav b/assets/gemma4_audio_test_chunk0_30s.wav new file mode 100644 index 0000000000000000000000000000000000000000..49d8266be264df06cb4f1152d0a6ba085f54688b --- /dev/null +++ b/assets/gemma4_audio_test_chunk0_30s.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75c6f4594fb977e8c762f79ea6d2b10cc1fc95037a5a1d26f7fe11351efa9e66 +size 960294 diff --git a/assets/gemma4_audio_test_chunk1_30s.wav b/assets/gemma4_audio_test_chunk1_30s.wav new file mode 100644 index 0000000000000000000000000000000000000000..ccc67fa2087e93817af19edc72f01a10703200de --- /dev/null +++ b/assets/gemma4_audio_test_chunk1_30s.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61aeb20520ef395a83b3ac06f21d128c5572c90cae3f211287cb1b302bbb56b5 +size 960294 diff --git a/assets/gemma4_axera_banner.jpg b/assets/gemma4_axera_banner.jpg new file mode 100644 index 0000000000000000000000000000000000000000..61a5a851ac3166cfff58d6a687d15e66967f9a72 --- /dev/null +++ b/assets/gemma4_axera_banner.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:317b751842963374eae394fc6d109911a5b895b72bd47ce5e4dc2ff75cb6615b +size 505075 diff --git a/assets/red-panda-openai.mp4 b/assets/red-panda-openai.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..28ff3b1291a2cb3525220a86a2b2b17156735848 --- /dev/null +++ b/assets/red-panda-openai.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d921c07bb97224d65a37801541d246067f0d506f08723ffa1ad85c217907ccb8 +size 1867237 diff --git a/assets/sample.png b/assets/sample.png new file mode 100644 index 0000000000000000000000000000000000000000..31281500cca3de9cb8ae9ae06da8ccf84afeea38 --- /dev/null +++ b/assets/sample.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e10040a55718d1e1157d919fd44051728bc9329e0e28008f940c6a316712e0cf +size 838119 diff --git a/bin/axllm b/bin/axllm new file mode 100644 index 0000000000000000000000000000000000000000..799a4dafff54f160b00fef17711f32b8ca26c7e3 --- /dev/null +++ b/bin/axllm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01c1948e316d96372fecab0968e21c8cff608ef80222a1cc6720161153bff913 +size 2507312 diff --git a/config.json b/config.json new file mode 100644 index 0000000000000000000000000000000000000000..f18543877b6fc34164daae31bc0257ae3b920a67 --- /dev/null +++ b/config.json @@ -0,0 +1,135 @@ +{ + "mem_guard_on_unsafe": "warn", + "system_prompt": "You are a helpful assistant.", + "model_name": "AXERA-TECH/gemma-4-E4B-it-GPTQ-INT4-P6K-C8K", + "url_tokenizer_model": "gemma4_tokenizer.txt", + "tokenizer_type": "Gemma4VL", + "post_config_path": "post_config.json", + "template_filename_axmodel": "gemma4_text_p256_l%d_together.axmodel", + "axmodel_num": 42, + "filename_post_axmodel": "gemma4_text_post.axmodel", + "filename_tokens_embed": "model.embed_tokens.weight.bfloat16.bin", + "tokens_embed_num": 262144, + "tokens_embed_size": 2560, + "text_config": { + "hidden_size": 2560, + "num_hidden_layers": 42, + "num_key_value_heads": 2, + "head_dim": 256, + "global_head_dim": 512, + "num_kv_shared_layers": 18, + "layer_types": [ + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention" + ], + "sliding_window": 512 + }, + "pad_token_id": 0, + "hidden_size_per_layer_input": 256, + "rms_norm_eps": 1e-06, + "filename_tokens_embed_per_layer": "model.embed_tokens_per_layer.weight.npy", + "filename_per_layer_model_projection": "model.per_layer_model_projection.weight.npy", + "filename_per_layer_projection_norm": "model.per_layer_projection_norm.weight.npy", + "use_mmap_load_embed": true, + "use_mmap_load_layer": true, + "vlm_type": "Gemma4VL", + "filename_image_encoder_axmodel": "gemma4_vision_h336_w480_t70.axmodel", + "vision_width": 480, + "vision_height": 336, + "vision_patch_size": 16, + "vision_cache_dir": "vision_cache", + "filename_audio_encoder_axmodel_5s": "gemma4_audio_5s.axmodel", + "filename_audio_encoder_axmodel_30s": "gemma4_audio_30s.axmodel", + "devices": [ + 0 + ], + "global_head_dim": 512, + "head_dim": 256, + "num_key_value_heads": 2, + "layer_types": [ + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention" + ], + "sliding_window": 512, + "num_kv_shared_layers": 18 +} diff --git a/gemma4_audio_30s.axmodel b/gemma4_audio_30s.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..a605353262c5581709cc484093f84705ee4649f1 --- /dev/null +++ b/gemma4_audio_30s.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:faa73b53f768934a22e99cb4eca78f6d7d4aa25153b7cd74349421802ccf0cdb +size 328904141 diff --git a/gemma4_audio_5s.axmodel b/gemma4_audio_5s.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..aabba20226c7d0ed60ba0c6cc76aeaba2fc4cf08 --- /dev/null +++ b/gemma4_audio_5s.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76cb423cde2a1a9561e02b2e717e1922e3257bdfa55c59f71a34edb12d460f64 +size 323406137 diff --git a/gemma4_text_p256_l0_together.axmodel b/gemma4_text_p256_l0_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..60aac485e4b4146a97e32fc84fbdd823f6ebadd1 --- /dev/null +++ b/gemma4_text_p256_l0_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0f044da22c401c7626dc46b08080fbabd707cdfb11e5b5cf94438725c4ed42f +size 109942098 diff --git a/gemma4_text_p256_l10_together.axmodel b/gemma4_text_p256_l10_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..72e0ef85c924b31c264f258c75b0c4f81294df19 --- /dev/null +++ b/gemma4_text_p256_l10_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a0fb3cdb8ead3b1067f9e744196ce27c764e7404e92f04478f78445acb97970 +size 109942162 diff --git a/gemma4_text_p256_l11_together.axmodel b/gemma4_text_p256_l11_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..3acfeadee4b9102222af84219347f400a98b41be --- /dev/null +++ b/gemma4_text_p256_l11_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:464bc239946c9269586f4170adf7d22241266eded39b43e245e430533952fb3c +size 145877586 diff --git a/gemma4_text_p256_l12_together.axmodel b/gemma4_text_p256_l12_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..1e627e4a3aa78b20794edc6d0209093ef807a305 --- /dev/null +++ b/gemma4_text_p256_l12_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ae9f4df65792f811f038277457c8c208bc96bae497aae5249d025bf5072ce66 +size 109942162 diff --git a/gemma4_text_p256_l13_together.axmodel b/gemma4_text_p256_l13_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..fddeb9b989e5857d0b85ae1b40088427eab6cf76 --- /dev/null +++ b/gemma4_text_p256_l13_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7427d88e958793c580875a04e0a7ac2e39f9f6664dba78b4c5c8be027a40d10b +size 109942162 diff --git a/gemma4_text_p256_l14_together.axmodel b/gemma4_text_p256_l14_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..2221fde45c9048b60861d56b87f366139d61b185 --- /dev/null +++ b/gemma4_text_p256_l14_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99ed8082d5488c332932d5fa49de38e56a9ede99ea329fa89331c7f406d16431 +size 109942162 diff --git a/gemma4_text_p256_l15_together.axmodel b/gemma4_text_p256_l15_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..9fd878b9f3cdde72a2abd7ad3b84d52c325f9b26 --- /dev/null +++ b/gemma4_text_p256_l15_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51f3fb4a0010977ab7a3dd2b3ec0a4e68a3d6af25c549a08dcfe78473b4d75b7 +size 109942162 diff --git a/gemma4_text_p256_l16_together.axmodel b/gemma4_text_p256_l16_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..b41a19091bce8310a9b5bfe67c353ef3ed28a22b --- /dev/null +++ b/gemma4_text_p256_l16_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63f46551e537112e341383c2992bf4100efaeb3cd81084bbd0a05a6dce3a8759 +size 109942226 diff --git a/gemma4_text_p256_l17_together.axmodel b/gemma4_text_p256_l17_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..9574d42f6859f96d8a5e16b41e285dd3123415da --- /dev/null +++ b/gemma4_text_p256_l17_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:532f31f1c1d2b284dc8f07056d70c595c3046420bcc4b2573ee4ed158de720eb +size 145877586 diff --git a/gemma4_text_p256_l18_together.axmodel b/gemma4_text_p256_l18_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..817a2896fd58d8306e5abd0e0a126b5d1c1beaca --- /dev/null +++ b/gemma4_text_p256_l18_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bd269afeb7cac90956fb0fe3d647dd6bed7771a5359aed97e8a91de453e119d +size 109942162 diff --git a/gemma4_text_p256_l19_together.axmodel b/gemma4_text_p256_l19_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..4e0f43eeb8e04fe1198eb853ede1a7f28cc798a5 --- /dev/null +++ b/gemma4_text_p256_l19_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a6503ce847bce6f9759cab57357758410f48a87981edda561f2d9ae5e0ae0a2 +size 109942162 diff --git a/gemma4_text_p256_l1_together.axmodel b/gemma4_text_p256_l1_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..ef0926f758779a82afa34fa37a292601e876985d --- /dev/null +++ b/gemma4_text_p256_l1_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:100c0d172c3cc36a2333f72521482d59fa415144ab5ee35bd5ac5ce58863e498 +size 109942098 diff --git a/gemma4_text_p256_l20_together.axmodel b/gemma4_text_p256_l20_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..913f92d8a2693e81ffb8c609d4bf406d7b89d1e2 --- /dev/null +++ b/gemma4_text_p256_l20_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e6a7d3b4177072109dc0bd50b5fb22c50067d3a9a64d198a62de480c4c4232e +size 109835090 diff --git a/gemma4_text_p256_l21_together.axmodel b/gemma4_text_p256_l21_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..eed5c2b9f33063cdfdbebee49cef144182031bc7 --- /dev/null +++ b/gemma4_text_p256_l21_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbe4ade8e7c1fc925cffbe0d04b9ceb3e476af4712a11bf5d71bb7164eba049c +size 109942226 diff --git a/gemma4_text_p256_l22_together.axmodel b/gemma4_text_p256_l22_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..ada3fb4915efe2fddefbefd75073e9244fca4f15 --- /dev/null +++ b/gemma4_text_p256_l22_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6e40c808b4f2b5e61f7a50d616d052714916288f95f4f0268302dc3d562ef67 +size 109942226 diff --git a/gemma4_text_p256_l23_together.axmodel b/gemma4_text_p256_l23_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..4e424c89e4341fc9697773510072e50d84c1b458 --- /dev/null +++ b/gemma4_text_p256_l23_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa47ad388ab02d7943c9590a4af56fe1b1bcc1b75284967c23041bb616538b13 +size 145877586 diff --git a/gemma4_text_p256_l24_together.axmodel b/gemma4_text_p256_l24_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..0aad0e3ef309b2df208c0c3b5705196c8c940875 --- /dev/null +++ b/gemma4_text_p256_l24_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:011d77636eacd258ce15550a51b531aa0f994fbd0b912428ad3a6aed5d812800 +size 106277970 diff --git a/gemma4_text_p256_l25_together.axmodel b/gemma4_text_p256_l25_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..6804a26bb9a5408fd4758be0e70b8a484493d1fc --- /dev/null +++ b/gemma4_text_p256_l25_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a8cc30b1dfe9c71479ce1ebc264d769b1e9f2a04db34b9feead84d6e7181217 +size 106277874 diff --git a/gemma4_text_p256_l26_together.axmodel b/gemma4_text_p256_l26_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..eb44f898044fca03a7690f56e93ddd23952d2e03 --- /dev/null +++ b/gemma4_text_p256_l26_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b51f68af83144f90d69cfc2a7009f157a7ab21696f812e6f34a3aedd1c6a066 +size 106277906 diff --git a/gemma4_text_p256_l27_together.axmodel b/gemma4_text_p256_l27_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..dc89edf2beaf08c134ef1afcbdaa9e89edd25a26 --- /dev/null +++ b/gemma4_text_p256_l27_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a38e83f4ff7463514e607686d7689406dee842216818982fc796eb55d927805 +size 106277842 diff --git a/gemma4_text_p256_l28_together.axmodel b/gemma4_text_p256_l28_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..1ae20b0890d2fcafa205737ba52239e5c15276d7 --- /dev/null +++ b/gemma4_text_p256_l28_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:310d49ff1aeb6d867b047228bcf574dc6fb70d6b94ce67e8ab66fe03fcd8c6d7 +size 106277874 diff --git a/gemma4_text_p256_l29_together.axmodel b/gemma4_text_p256_l29_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..cf4371d52d20717434e1264cee6ce61e119e1191 --- /dev/null +++ b/gemma4_text_p256_l29_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0a8c75957fcde4d65ee02a121e4b8b957c229a38c3f0a67681a271e00284472 +size 139733374 diff --git a/gemma4_text_p256_l2_together.axmodel b/gemma4_text_p256_l2_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..290aa6f3bcdfb7a0755e606c564f69e42d0b49a3 --- /dev/null +++ b/gemma4_text_p256_l2_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad21515b7bd7c1a7bf8f309d645216c1c7c4a4c87a54e2719cde0141ec44f9bf +size 109942034 diff --git a/gemma4_text_p256_l30_together.axmodel b/gemma4_text_p256_l30_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..3e3fd8470b42b9b60558e3d89a15ae850341d073 --- /dev/null +++ b/gemma4_text_p256_l30_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b6085303f3aa848c268e059b6ae872f2ecce0fe65a4a762a67439277dc49acf +size 106278098 diff --git a/gemma4_text_p256_l31_together.axmodel b/gemma4_text_p256_l31_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..44434c2cfc35dfda2256697356a4b0ad82c2430c --- /dev/null +++ b/gemma4_text_p256_l31_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:420c775da629a1d37001e58f1ee6db63a91166e6959b89418c0ff8b78c0b4332 +size 106278098 diff --git a/gemma4_text_p256_l32_together.axmodel b/gemma4_text_p256_l32_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..c4a60975041a5ab22516ea657be9284d77641871 --- /dev/null +++ b/gemma4_text_p256_l32_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70756514579c6de17a29292ed99df5d4d464003a9ea555c158af5fa8a37e3a59 +size 106278066 diff --git a/gemma4_text_p256_l33_together.axmodel b/gemma4_text_p256_l33_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..3bbc548892167ab52aba2de50da2cefd8b441cad --- /dev/null +++ b/gemma4_text_p256_l33_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49f26b532014582336b14f962bce84f0c506047af695bba9a61417a7ee44704c +size 106278066 diff --git a/gemma4_text_p256_l34_together.axmodel b/gemma4_text_p256_l34_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..d797ef2600dd9a1de12e9702269d57d514314bcd --- /dev/null +++ b/gemma4_text_p256_l34_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e86efe91e1dc0a31ecb65dc35ce124f17658f13b467431f78346dff332e044c1 +size 106278066 diff --git a/gemma4_text_p256_l35_together.axmodel b/gemma4_text_p256_l35_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..4806f45ba51cf295667526294ceaaf777a44c23c --- /dev/null +++ b/gemma4_text_p256_l35_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4adbb0bef290ffd954bc37b97ce8c4f86fe1b921b80f791f2d3b558b55e0e356 +size 139733918 diff --git a/gemma4_text_p256_l36_together.axmodel b/gemma4_text_p256_l36_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..06099bf256a5c5ef47883e10e41c5cb56c3fbb73 --- /dev/null +++ b/gemma4_text_p256_l36_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ac7f6335bc3d38d5360fe2a5451fc08e6152aff07a09201378ede79807800d5 +size 106278066 diff --git a/gemma4_text_p256_l37_together.axmodel b/gemma4_text_p256_l37_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..422dbd41acf4f7da29840b87f12719ab40200abc --- /dev/null +++ b/gemma4_text_p256_l37_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da17bae13c5a3c9f662ff4dd8bcafb663ab30de468ee7387dd05b06316c17a19 +size 106278066 diff --git a/gemma4_text_p256_l38_together.axmodel b/gemma4_text_p256_l38_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..cb7e0870f80753a7ef77ed8effdbfe68ff5cc361 --- /dev/null +++ b/gemma4_text_p256_l38_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a96d871d8cb2b0ade211b552b268a7b795d484db33390b60bfb0878efd685d9d +size 106278066 diff --git a/gemma4_text_p256_l39_together.axmodel b/gemma4_text_p256_l39_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..8084c22ca666322fcc4a8a447c8de50c8174135e --- /dev/null +++ b/gemma4_text_p256_l39_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:303914b63b2be4f7fd65410518905b4996863e73502aa963f43b27dded54a88e +size 106278066 diff --git a/gemma4_text_p256_l3_together.axmodel b/gemma4_text_p256_l3_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..dd287012af29f382ed3a953f2de954ea96414221 --- /dev/null +++ b/gemma4_text_p256_l3_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cad8098eb26b4a06e00f1b7c81a46d637e5ccab1c34f31bacb25b8f5d8d148d2 +size 109942034 diff --git a/gemma4_text_p256_l40_together.axmodel b/gemma4_text_p256_l40_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..36c9f20e99b91bc48f4d16bbf31598bd577705d9 --- /dev/null +++ b/gemma4_text_p256_l40_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d31bbb42fd9a9e2fe10628509516243ac284ccc093fbbee692d9bf90e7df614f +size 106278066 diff --git a/gemma4_text_p256_l41_together.axmodel b/gemma4_text_p256_l41_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..906e8c1c41ba8b94d13addfa414f8a00cf07e7fb --- /dev/null +++ b/gemma4_text_p256_l41_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bd5234f9af81382993a139370ca431d8652005ec5ef8392e243d347dfdf374e +size 139733374 diff --git a/gemma4_text_p256_l4_together.axmodel b/gemma4_text_p256_l4_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..2fa03e1d230057e167dd156f238a523295621aaa --- /dev/null +++ b/gemma4_text_p256_l4_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:307c26b63eb8edbfc8b7a323e08d7be1154ac790d0b15769761c89f22adfee59 +size 109942034 diff --git a/gemma4_text_p256_l5_together.axmodel b/gemma4_text_p256_l5_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..f6d74f3884f5e15732067a3ce647a4589451cf04 --- /dev/null +++ b/gemma4_text_p256_l5_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1b91b097b3b4ae5b1f3b0d7b1cdd5cf828b7cbf207bcbd15ea86958990006df +size 145877466 diff --git a/gemma4_text_p256_l6_together.axmodel b/gemma4_text_p256_l6_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..be47ec55dba62607ce4d87aceb4aed7d8ff1af89 --- /dev/null +++ b/gemma4_text_p256_l6_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb2bf661b7f4ca7981640f03aa2e37edc5e5f3d3df32978a0b0b38cf085ddb63 +size 109942034 diff --git a/gemma4_text_p256_l7_together.axmodel b/gemma4_text_p256_l7_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..6aaabfefee5913c9c31f1e9cd19eee21b053ace8 --- /dev/null +++ b/gemma4_text_p256_l7_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4d1130d04dd48a803c8df2a01ce9dc8c2172aea4f15a7fc5f6b13420cafc9aa +size 109942034 diff --git a/gemma4_text_p256_l8_together.axmodel b/gemma4_text_p256_l8_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..2f6bf29f3b00b8e03ce5b9db62f8ab33c7108b2a --- /dev/null +++ b/gemma4_text_p256_l8_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09de12003a5f801cfa7ebe8a77fb7431c56bcf759fc6a1d2b5cedaeaff977d6d +size 109942034 diff --git a/gemma4_text_p256_l9_together.axmodel b/gemma4_text_p256_l9_together.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..ee5c6db110dc9b2e6c87b24b561d3ccc631fe97a --- /dev/null +++ b/gemma4_text_p256_l9_together.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:327a128f52e3cc5cd67bf019ffe641329bf7ec2cd81d20ab5ea355f621a6ba43 +size 109942034 diff --git a/gemma4_text_post.axmodel b/gemma4_text_post.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..38ff472c61276ab7ed08d8e32be492e2d1bea0fd --- /dev/null +++ b/gemma4_text_post.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83d85989249941152c6431e9c05884750e162766a2d8e3d1ce5ca1e2b36ff90c +size 732636504 diff --git a/gemma4_tokenizer.txt b/gemma4_tokenizer.txt new file mode 100644 index 0000000000000000000000000000000000000000..02171f6131625af5a864361da10607c8b131bbc1 --- /dev/null +++ b/gemma4_tokenizer.txt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90603c2c15f0d202d63c5c7767e4787e7e3909d74ee2c47f93914d3575dbd0ef +size 17165772 diff --git a/gemma4_vision_h336_w480_t70.axmodel b/gemma4_vision_h336_w480_t70.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..fb40a6c10b55c5e66412c2765763e785b4ca0df1 --- /dev/null +++ b/gemma4_vision_h336_w480_t70.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f00f537f040acb0e5a899faa3129fcad37d49875c7f25d69b98abb315a7c862b +size 176132082 diff --git a/gemma4_vision_h480_w672_t140.axmodel b/gemma4_vision_h480_w672_t140.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..4399c1b1cab6b04c6237de52bd58d23d81a96cc5 --- /dev/null +++ b/gemma4_vision_h480_w672_t140.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a47ff810e61397187d97b851174d1ad8b2aa9c2a958face9a4d4397d46da7f49 +size 189344773 diff --git a/gemma4_vision_h672_w960_t280.axmodel b/gemma4_vision_h672_w960_t280.axmodel new file mode 100644 index 0000000000000000000000000000000000000000..4b6444205c894aa85a3835898b176bcf71781d1e --- /dev/null +++ b/gemma4_vision_h672_w960_t280.axmodel @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c11b44e9033f4eaa03b204224ab41822ee12c1175e0261259f9be947db95c74 +size 274871912 diff --git a/gemma_4_e4b_it_tokenizer/chat_template.jinja b/gemma_4_e4b_it_tokenizer/chat_template.jinja new file mode 100644 index 0000000000000000000000000000000000000000..16fdd65d5dd3d199bc6c4e851a44583d27c52aae --- /dev/null +++ b/gemma_4_e4b_it_tokenizer/chat_template.jinja @@ -0,0 +1,340 @@ +{%- macro format_parameters(properties, required, filter_keys=false) -%} + {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%} + {%- set ns = namespace(found_first=false) -%} + {%- for key, value in properties | dictsort -%} + {%- set add_comma = false -%} + {%- if not filter_keys or key not in standard_keys -%} + {%- if ns.found_first %},{% endif -%} + {%- set ns.found_first = true -%} + {{ key }}:{ + {%- if value['description'] -%} + description:<|"|>{{ value['description'] }}<|"|> + {%- set add_comma = true -%} + {%- endif -%} + {%- if value['type'] | upper == 'STRING' -%} + {%- if value['enum'] -%} + {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%} + enum:{{ format_argument(value['enum']) }} + {%- endif -%} + {%- elif value['type'] | upper == 'ARRAY' -%} + {%- if value['items'] is mapping and value['items'] -%} + {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%} + items:{ + {%- set ns_items = namespace(found_first=false) -%} + {%- for item_key, item_value in value['items'] | dictsort -%} + {%- if item_value is not none -%} + {%- if ns_items.found_first %},{% endif -%} + {%- set ns_items.found_first = true -%} + {%- if item_key == 'properties' -%} + properties:{ + {%- if item_value is mapping -%} + {{- format_parameters(item_value, value['items']['required'] | default([])) -}} + {%- endif -%} + } + {%- elif item_key == 'required' -%} + required:[ + {%- for req_item in item_value -%} + <|"|>{{- req_item -}}<|"|> + {%- if not loop.last %},{% endif -%} + {%- endfor -%} + ] + {%- elif item_key == 'type' -%} + {%- if item_value is string -%} + type:{{ format_argument(item_value | upper) }} + {%- else -%} + type:{{ format_argument(item_value | map('upper') | list) }} + {%- endif -%} + {%- else -%} + {{ item_key }}:{{ format_argument(item_value) }} + {%- endif -%} + {%- endif -%} + {%- endfor -%} + } + {%- endif -%} + {%- endif -%} + {%- if value['nullable'] %} + {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%} + nullable:true + {%- endif -%} + {%- if value['type'] | upper == 'OBJECT' -%} + {%- if value['properties'] is defined and value['properties'] is mapping -%} + {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%} + properties:{ + {{- format_parameters(value['properties'], value['required'] | default([])) -}} + } + {%- elif value is mapping -%} + {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%} + properties:{ + {{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}} + } + {%- endif -%} + {%- if value['required'] -%} + {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%} + required:[ + {%- for item in value['required'] | default([]) -%} + <|"|>{{- item -}}<|"|> + {%- if not loop.last %},{% endif -%} + {%- endfor -%} + ] + {%- endif -%} + {%- endif -%} + {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%} + type:<|"|>{{ value['type'] | upper }}<|"|>} + {%- endif -%} + {%- endfor -%} +{%- endmacro -%} +{%- macro format_function_declaration(tool_data) -%} + declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|> + {%- set params = tool_data['function']['parameters'] -%} + {%- if params -%} + ,parameters:{ + {%- if params['properties'] -%} + properties:{ {{- format_parameters(params['properties'], params['required']) -}} }, + {%- endif -%} + {%- if params['required'] -%} + required:[ + {%- for item in params['required'] -%} + <|"|>{{- item -}}<|"|> + {{- ',' if not loop.last -}} + {%- endfor -%} + ], + {%- endif -%} + {%- if params['type'] -%} + type:<|"|>{{- params['type'] | upper -}}<|"|>} + {%- endif -%} + {%- endif -%} + {%- if 'response' in tool_data['function'] -%} + {%- set response_declaration = tool_data['function']['response'] -%} + ,response:{ + {%- if response_declaration['description'] -%} + description:<|"|>{{- response_declaration['description'] -}}<|"|>, + {%- endif -%} + {%- if response_declaration['type'] | upper == 'OBJECT' -%} + type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>} + {%- endif -%} + {%- endif -%} + } +{%- endmacro -%} +{%- macro format_argument(argument, escape_keys=True) -%} + {%- if argument is string -%} + {{- '<|"|>' + argument + '<|"|>' -}} + {%- elif argument is boolean -%} + {{- 'true' if argument else 'false' -}} + {%- elif argument is mapping -%} + {{- '{' -}} + {%- set ns = namespace(found_first=false) -%} + {%- for key, value in argument | dictsort -%} + {%- if ns.found_first %},{% endif -%} + {%- set ns.found_first = true -%} + {%- if escape_keys -%} + {{- '<|"|>' + key + '<|"|>' -}} + {%- else -%} + {{- key -}} + {%- endif -%} + :{{- format_argument(value, escape_keys=escape_keys) -}} + {%- endfor -%} + {{- '}' -}} + {%- elif argument is sequence -%} + {{- '[' -}} + {%- for item in argument -%} + {{- format_argument(item, escape_keys=escape_keys) -}} + {%- if not loop.last %},{% endif -%} + {%- endfor -%} + {{- ']' -}} + {%- else -%} + {{- argument -}} + {%- endif -%} +{%- endmacro -%} +{%- macro strip_thinking(text) -%} + {%- set ns = namespace(result='') -%} + {%- for part in text.split('') -%} + {%- if '<|channel>' in part -%} + {%- set ns.result = ns.result + part.split('<|channel>')[0] -%} + {%- else -%} + {%- set ns.result = ns.result + part -%} + {%- endif -%} + {%- endfor -%} + {{- ns.result | trim -}} +{%- endmacro -%} +{%- macro format_tool_response_block(tool_name, response) -%} + {{- '<|tool_response>' -}} + {%- if response is mapping -%} + {{- 'response:' + tool_name + '{' -}} + {%- for key, value in response | dictsort -%} + {{- key -}}:{{- format_argument(value, escape_keys=False) -}} + {%- if not loop.last %},{% endif -%} + {%- endfor -%} + {{- '}' -}} + {%- else -%} + {{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}} + {%- endif -%} + {{- '' -}} +{%- endmacro -%} +{%- set ns = namespace(prev_message_type=None) -%} +{%- set loop_messages = messages -%} +{{- bos_token -}} +{#- Handle System/Tool Definitions Block -#} +{%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%} + {{- '<|turn>system\n' -}} + {#- Inject Thinking token at the very top of the FIRST system turn -#} + {%- if enable_thinking is defined and enable_thinking -%} + {{- '<|think|>\n' -}} + {%- set ns.prev_message_type = 'think' -%} + {%- endif -%} + {%- if messages[0]['role'] in ['system', 'developer'] -%} + {%- if messages[0]['content'] is string -%} + {{- messages[0]['content'] | trim -}} + {%- elif messages[0]['content'] is sequence -%} + {%- for item in messages[0]['content'] -%} + {{- item['text'] | trim + ' '-}} + {%- endfor -%} + {%- endif -%} + {%- set loop_messages = messages[1:] -%} + {%- endif -%} + {%- if tools -%} + {%- for tool in tools %} + {{- '<|tool>' -}} + {{- format_function_declaration(tool) | trim -}} + {{- '' -}} + {%- endfor %} + {%- set ns.prev_message_type = 'tool' -%} + {%- endif -%} + {{- '\n' -}} +{%- endif %} +{#- Pre-scan: find last user message index for reasoning guard -#} +{%- set ns_turn = namespace(last_user_idx=-1) -%} +{%- for i in range(loop_messages | length) -%} + {%- if loop_messages[i]['role'] == 'user' -%} + {%- set ns_turn.last_user_idx = i -%} + {%- endif -%} +{%- endfor -%} +{#- Loop through messages -#} +{%- for message in loop_messages -%} + {%- if message['role'] != 'tool' -%} + {%- set ns.prev_message_type = None -%} + {%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%} + {#- Detect continuation: suppress duplicate <|turn>model when previous non-tool message was also assistant -#} + {%- set prev_nt = namespace(role=None, found=false) -%} + {%- if loop.index0 > 0 -%} + {%- for j in range(loop.index0 - 1, -1, -1) -%} + {%- if not prev_nt.found -%} + {%- if loop_messages[j]['role'] != 'tool' -%} + {%- set prev_nt.role = loop_messages[j]['role'] -%} + {%- set prev_nt.found = true -%} + {%- endif -%} + {%- endif -%} + {%- endfor -%} + {%- endif -%} + {%- set continue_same_model_turn = (role == 'model' and prev_nt.role == 'assistant') -%} + {%- if not continue_same_model_turn -%} + {{- '<|turn>' + role + '\n' }} + {%- endif -%} + {#- Render reasoning/reasoning_content as thinking channel -#} + {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%} + {%- if thinking_text and loop.index0 > ns_turn.last_user_idx and message.get('tool_calls') -%} + {{- '<|channel>thought\n' + thinking_text + '\n' -}} + {%- endif -%} + {%- if message['tool_calls'] -%} + {%- for tool_call in message['tool_calls'] -%} + {%- set function = tool_call['function'] -%} + {{- '<|tool_call>call:' + function['name'] + '{' -}} + {%- if function['arguments'] is mapping -%} + {%- set ns_args = namespace(found_first=false) -%} + {%- for key, value in function['arguments'] | dictsort -%} + {%- if ns_args.found_first %},{% endif -%} + {%- set ns_args.found_first = true -%} + {{- key -}}:{{- format_argument(value, escape_keys=False) -}} + {%- endfor -%} + {%- elif function['arguments'] is string -%} + {{- function['arguments'] -}} + {%- endif -%} + {{- '}' -}} + {%- endfor -%} + {%- set ns.prev_message_type = 'tool_call' -%} + {%- endif -%} + {%- set ns_tr_out = namespace(flag=false) -%} + {%- if message.get('tool_responses') -%} + {#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#} + {%- for tool_response in message['tool_responses'] -%} + {{- format_tool_response_block(tool_response['name'] | default('unknown'), tool_response['response']) -}} + {%- set ns_tr_out.flag = true -%} + {%- set ns.prev_message_type = 'tool_response' -%} + {%- endfor -%} + {%- elif message.get('tool_calls') -%} + {#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#} + {%- set ns_tool_scan = namespace(stopped=false) -%} + {%- for k in range(loop.index0 + 1, loop_messages | length) -%} + {%- if ns_tool_scan.stopped -%} + {%- elif loop_messages[k]['role'] != 'tool' -%} + {%- set ns_tool_scan.stopped = true -%} + {%- else -%} + {%- set follow = loop_messages[k] -%} + {#- Resolve tool_call_id to function name -#} + {%- set ns_tname = namespace(name=follow.get('name') | default('unknown')) -%} + {%- for tc in message['tool_calls'] -%} + {%- if tc.get('id') == follow.get('tool_call_id') -%} + {%- set ns_tname.name = tc['function']['name'] -%} + {%- endif -%} + {%- endfor -%} + {#- Handle content as string or content-parts array -#} + {%- set tool_body = follow.get('content') -%} + {%- if tool_body is string -%} + {{- format_tool_response_block(ns_tname.name, tool_body) -}} + {%- elif tool_body is sequence and tool_body is not string -%} + {%- set ns_txt = namespace(s='') -%} + {%- for part in tool_body -%} + {%- if part.get('type') == 'text' -%} + {%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%} + {%- endif -%} + {%- endfor -%} + {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}} + {%- else -%} + {{- format_tool_response_block(ns_tname.name, tool_body) -}} + {%- endif -%} + {%- set ns_tr_out.flag = true -%} + {%- set ns.prev_message_type = 'tool_response' -%} + {%- endif -%} + {%- endfor -%} + {%- endif -%} + {%- set captured_content -%} + {%- if message['content'] is string -%} + {%- if role == 'model' -%} + {{- strip_thinking(message['content']) -}} + {%- else -%} + {{- message['content'] | trim -}} + {%- endif -%} + {%- elif message['content'] is sequence -%} + {%- for item in message['content'] -%} + {%- if item['type'] == 'text' -%} + {%- if role == 'model' -%} + {{- strip_thinking(item['text']) -}} + {%- else -%} + {{- item['text'] | trim -}} + {%- endif -%} + {%- elif item['type'] == 'image' -%} + {{- '<|image|>' -}} + {%- set ns.prev_message_type = 'image' -%} + {%- elif item['type'] == 'audio' -%} + {{- '<|audio|>' -}} + {%- set ns.prev_message_type = 'audio' -%} + {%- elif item['type'] == 'video' -%} + {{- '<|video|>' -}} + {%- set ns.prev_message_type = 'video' -%} + {%- endif -%} + {%- endfor -%} + {%- endif -%} + {%- endset -%} + {{- captured_content -}} + {%- set has_content = captured_content | trim | length > 0 -%} + {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%} + {{- '<|tool_response>' -}} + {%- elif not (ns_tr_out.flag and not has_content) -%} + {{- '\n' -}} + {%- endif -%} + {%- endif -%} +{%- endfor -%} +{%- if add_generation_prompt -%} + {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%} + {{- '<|turn>model\n' -}} + {%- endif -%} +{%- endif -%} \ No newline at end of file diff --git a/gemma_4_e4b_it_tokenizer/config.json b/gemma_4_e4b_it_tokenizer/config.json new file mode 100644 index 0000000000000000000000000000000000000000..a3bca17872149b530cc94e1971bbd51bc1e33463 --- /dev/null +++ b/gemma_4_e4b_it_tokenizer/config.json @@ -0,0 +1,578 @@ +{ + "architectures": [ + "Gemma4ForConditionalGeneration" + ], + "audio_config": { + "_name_or_path": "", + "architectures": null, + "attention_chunk_size": 12, + "attention_context_left": 13, + "attention_context_right": 0, + "attention_invalid_logits_value": -1000000000.0, + "attention_logit_cap": 50.0, + "chunk_size_feed_forward": 0, + "conv_kernel_size": 5, + "dtype": "bfloat16", + "gradient_clipping": 10000000000.0, + "hidden_act": "silu", + "hidden_size": 1024, + "id2label": { + "0": "LABEL_0", + "1": "LABEL_1" + }, + "initializer_range": 0.02, + "is_encoder_decoder": false, + "label2id": { + "LABEL_0": 0, + "LABEL_1": 1 + }, + "model_type": "gemma4_audio", + "num_attention_heads": 8, + "num_hidden_layers": 12, + "output_attentions": false, + "output_hidden_states": false, + "output_proj_dims": 1536, + "problem_type": null, + "residual_weight": 0.5, + "return_dict": true, + "rms_norm_eps": 1e-06, + "subsampling_conv_channels": [ + 128, + 32 + ], + "use_clipped_linears": true + }, + "audio_token_id": 258881, + "boa_token_id": 256000, + "boi_token_id": 255999, + "dtype": "float16", + "eoa_token_id": 258883, + "eoa_token_index": 258883, + "eoi_token_id": 258882, + "eos_token_id": [ + 1, + 106 + ], + "image_token_id": 258880, + "initializer_range": 0.02, + "model_type": "gemma4", + "quantization_config": { + "autoround_version": "0.13.0", + "bits": 4, + "damp_percent": 0.01, + "data_type": "int", + "desc_act": false, + "dynamic": { + "-:.*model\\.audio_tower.*": {}, + "-:.*model\\.audio_tower\\.layers.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.0\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.10\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.11\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.1\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.2\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.3\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.4\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.5\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.6\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.7\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.8\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.feed_forward1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.feed_forward1\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.feed_forward1\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.feed_forward2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.feed_forward2\\.ffw_layer_1.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.feed_forward2\\.ffw_layer_2.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.lconv1d.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.lconv1d\\.linear_end.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.lconv1d\\.linear_start.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.self_attn.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.self_attn\\.post.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.audio_tower\\.layers\\.9\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.audio_tower\\.subsample_conv_projection.*": {}, + "-:.*model\\.audio_tower\\.subsample_conv_projection\\.layer0.*": {}, + "-:.*model\\.audio_tower\\.subsample_conv_projection\\.layer1.*": {}, + "-:.*model\\.vision_tower.*": {}, + "-:.*model\\.vision_tower\\.encoder.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.0\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.10\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.11\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.12\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.13\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.14\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.15\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.1\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.2\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.3\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.4\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.5\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.6\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.7\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.8\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9\\.mlp.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9\\.mlp\\.down_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9\\.mlp\\.gate_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9\\.mlp\\.up_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9\\.self_attn.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9\\.self_attn\\.k_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9\\.self_attn\\.o_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9\\.self_attn\\.q_proj.*": {}, + "-:.*model\\.vision_tower\\.encoder\\.layers\\.9\\.self_attn\\.v_proj.*": {}, + "-:.*model\\.vision_tower\\.patch_embedder.*": {} + }, + "group_size": 128, + "iters": 0, + "lm_head": false, + "modules_in_block_to_quantize": [ + [ + "self_attn.q_proj", + "self_attn.k_proj", + "self_attn.v_proj", + "self_attn.o_proj", + "mlp.gate_proj", + "mlp.up_proj", + "mlp.down_proj", + "per_layer_input_gate", + "per_layer_projection" + ] + ], + "nsamples": 256, + "provider": "auto-round", + "quant_method": "gptq", + "sym": true, + "true_sequential": false + }, + "text_config": { + "attention_bias": false, + "attention_dropout": 0.0, + "attention_k_eq_v": false, + "bos_token_id": 2, + "dtype": "bfloat16", + "enable_moe_block": false, + "eos_token_id": 1, + "expert_intermediate_size": null, + "final_logit_softcapping": 30.0, + "global_head_dim": 512, + "head_dim": 256, + "hidden_activation": "gelu_pytorch_tanh", + "hidden_size": 2560, + "hidden_size_per_layer_input": 256, + "initializer_range": 0.02, + "intermediate_size": 10240, + "layer_types": [ + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "sliding_attention", + "full_attention" + ], + "max_position_embeddings": 131072, + "model_type": "gemma4_text", + "moe_intermediate_size": null, + "num_attention_heads": 8, + "num_experts": null, + "num_global_key_value_heads": null, + "num_hidden_layers": 42, + "num_key_value_heads": 2, + "num_kv_shared_layers": 18, + "pad_token_id": 0, + "rms_norm_eps": 1e-06, + "rope_parameters": { + "full_attention": { + "partial_rotary_factor": 0.25, + "rope_theta": 1000000.0, + "rope_type": "proportional" + }, + "sliding_attention": { + "rope_theta": 10000.0, + "rope_type": "default" + } + }, + "sliding_window": 512, + "tie_word_embeddings": true, + "top_k_experts": null, + "use_bidirectional_attention": null, + "use_cache": true, + "use_double_wide_mlp": false, + "vocab_size": 262144, + "vocab_size_per_layer_input": 262144 + }, + "tie_word_embeddings": true, + "transformers_version": "5.5.3", + "video_token_id": 258884, + "vision_config": { + "_name_or_path": "", + "architectures": null, + "attention_bias": false, + "attention_dropout": 0.0, + "chunk_size_feed_forward": 0, + "default_output_length": 280, + "dtype": "bfloat16", + "global_head_dim": 64, + "head_dim": 64, + "hidden_activation": "gelu_pytorch_tanh", + "hidden_size": 768, + "id2label": { + "0": "LABEL_0", + "1": "LABEL_1" + }, + "initializer_range": 0.02, + "intermediate_size": 3072, + "is_encoder_decoder": false, + "label2id": { + "LABEL_0": 0, + "LABEL_1": 1 + }, + "max_position_embeddings": 131072, + "model_type": "gemma4_vision", + "num_attention_heads": 12, + "num_hidden_layers": 16, + "num_key_value_heads": 12, + "output_attentions": false, + "output_hidden_states": false, + "patch_size": 16, + "pooling_kernel_size": 3, + "position_embedding_size": 10240, + "problem_type": null, + "return_dict": true, + "rms_norm_eps": 1e-06, + "rope_parameters": { + "rope_theta": 100.0, + "rope_type": "default" + }, + "standardize": false, + "use_clipped_linears": true + }, + "vision_soft_tokens_per_image": 280, + "torch_dtype": "float16" +} \ No newline at end of file diff --git a/gemma_4_e4b_it_tokenizer/generation_config.json b/gemma_4_e4b_it_tokenizer/generation_config.json new file mode 100644 index 0000000000000000000000000000000000000000..92b5abfd502d37da6983fa2f7f794583c3646c7c --- /dev/null +++ b/gemma_4_e4b_it_tokenizer/generation_config.json @@ -0,0 +1,14 @@ +{ + "bos_token_id": 2, + "do_sample": true, + "eos_token_id": [ + 1, + 106, + 50 + ], + "pad_token_id": 0, + "temperature": 1.0, + "top_k": 64, + "top_p": 0.95, + "transformers_version": "5.5.3" +} diff --git a/gemma_4_e4b_it_tokenizer/processor_config.json b/gemma_4_e4b_it_tokenizer/processor_config.json new file mode 100644 index 0000000000000000000000000000000000000000..5465974d23e1eca2c46c2809b26c997946ce0d90 --- /dev/null +++ b/gemma_4_e4b_it_tokenizer/processor_config.json @@ -0,0 +1,75 @@ +{ + "audio_ms_per_token": 40, + "audio_seq_length": 750, + "feature_extractor": { + "dither": 0.0, + "feature_extractor_type": "Gemma4AudioFeatureExtractor", + "feature_size": 128, + "fft_length": 512, + "fft_overdrive": false, + "frame_length": 320, + "hop_length": 160, + "input_scale_factor": 1.0, + "max_frequency": 8000.0, + "mel_floor": 0.001, + "min_frequency": 0.0, + "padding_side": "right", + "padding_value": 0.0, + "per_bin_mean": null, + "per_bin_stddev": null, + "preemphasis": 0.0, + "preemphasis_htk_flavor": true, + "return_attention_mask": true, + "sampling_rate": 16000 + }, + "image_processor": { + "do_convert_rgb": true, + "do_normalize": false, + "do_rescale": true, + "do_resize": true, + "image_mean": [ + 0.0, + 0.0, + 0.0 + ], + "image_processor_type": "Gemma4ImageProcessor", + "image_seq_length": 280, + "image_std": [ + 1.0, + 1.0, + 1.0 + ], + "max_soft_tokens": 280, + "patch_size": 16, + "pooling_kernel_size": 3, + "resample": 3, + "rescale_factor": 0.00392156862745098 + }, + "image_seq_length": 280, + "processor_class": "Gemma4Processor", + "video_processor": { + "do_convert_rgb": true, + "do_normalize": true, + "do_rescale": true, + "do_resize": true, + "do_sample_frames": true, + "image_mean": [ + 0.0, + 0.0, + 0.0 + ], + "image_std": [ + 1.0, + 1.0, + 1.0 + ], + "max_soft_tokens": 70, + "num_frames": 32, + "patch_size": 16, + "pooling_kernel_size": 3, + "resample": 3, + "rescale_factor": 0.00392156862745098, + "return_metadata": false, + "video_processor_type": "Gemma4VideoProcessor" + } +} diff --git a/gemma_4_e4b_it_tokenizer/tokenizer.json b/gemma_4_e4b_it_tokenizer/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..1ff9f3e3439a939b971f9919e821bf87e835a503 --- /dev/null +++ b/gemma_4_e4b_it_tokenizer/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f +size 32169626 diff --git a/gemma_4_e4b_it_tokenizer/tokenizer_config.json b/gemma_4_e4b_it_tokenizer/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..2d61cccb08b9cbe518e73cc8eb0ea8a0bc74dab8 --- /dev/null +++ b/gemma_4_e4b_it_tokenizer/tokenizer_config.json @@ -0,0 +1,95 @@ +{ + "audio_token": "<|audio|>", + "backend": "tokenizers", + "boa_token": "<|audio>", + "boi_token": "<|image>", + "bos_token": "", + "eoa_token": "", + "eoc_token": "", + "eoi_token": "", + "eos_token": "", + "eot_token": "", + "escape_token": "<|\"|>", + "etc_token": "", + "etd_token": "", + "etr_token": "", + "extra_special_tokens": [ + "<|video|>" + ], + "image_token": "<|image|>", + "is_local": true, + "mask_token": "", + "model_max_length": 1000000000000000019884624838656, + "model_specific_special_tokens": { + "audio_token": "<|audio|>", + "boa_token": "<|audio>", + "boi_token": "<|image>", + "eoa_token": "", + "eoc_token": "", + "eoi_token": "", + "eot_token": "", + "escape_token": "<|\"|>", + "etc_token": "", + "etd_token": "", + "etr_token": "", + "image_token": "<|image|>", + "soc_token": "<|channel>", + "sot_token": "<|turn>", + "stc_token": "<|tool_call>", + "std_token": "<|tool>", + "str_token": "<|tool_response>", + "think_token": "<|think|>" + }, + "pad_token": "", + "padding_side": "left", + "processor_class": "Gemma4Processor", + "response_schema": { + "properties": { + "content": { + "type": "string" + }, + "role": { + "const": "assistant" + }, + "thinking": { + "type": "string" + }, + "tool_calls": { + "items": { + "properties": { + "function": { + "properties": { + "arguments": { + "additionalProperties": {}, + "type": "object", + "x-parser": "gemma4-tool-call" + }, + "name": { + "type": "string" + } + }, + "type": "object", + "x-regex": "call\\:(?P\\w+)(?P\\{.*\\})" + }, + "type": { + "const": "function" + } + }, + "type": "object" + }, + "type": "array", + "x-regex-iterator": "<\\|tool_call>(.*?)" + } + }, + "type": "object", + "x-regex": "(\\<\\|channel\\>thought\\n(?P.*?)\\)?(?P\\<\\|tool_call\\>.*\\)?(?P(?:(?!\\)(?!\\<\\|tool_response\\>).)+)?(?:\\|\\<\\|tool_response\\>)?" + }, + "soc_token": "<|channel>", + "sot_token": "<|turn>", + "stc_token": "<|tool_call>", + "std_token": "<|tool>", + "str_token": "<|tool_response>", + "think_token": "<|think|>", + "tokenizer_class": "GemmaTokenizer", + "unk_token": "" +} diff --git a/model.embed_tokens.weight.bfloat16.bin b/model.embed_tokens.weight.bfloat16.bin new file mode 100644 index 0000000000000000000000000000000000000000..bc6cdeabe768eec9555e2e02b41081c2d90e6eff --- /dev/null +++ b/model.embed_tokens.weight.bfloat16.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d41d67b6c68cbf4e5858b1e680c1679879cbbc336a9d6251da578819e4d9721 +size 1342177280 diff --git a/model.embed_tokens_per_layer.weight.npy b/model.embed_tokens_per_layer.weight.npy new file mode 100644 index 0000000000000000000000000000000000000000..d0af545f795ad25bfdf2b42964ea4dc65e4387df --- /dev/null +++ b/model.embed_tokens_per_layer.weight.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bb7e7dd64c26fc8beae0149ad33e23306ffac1f7c7f6512f5874c2a8666a375 +size 5637144704 diff --git a/model.per_layer_model_projection.weight.npy b/model.per_layer_model_projection.weight.npy new file mode 100644 index 0000000000000000000000000000000000000000..621315c108f4c729d7bc31271bb0264421c572e8 --- /dev/null +++ b/model.per_layer_model_projection.weight.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:657d9b64de82da2562a8a2cafc708aed4021fd9682090c2a2f19eba831e7e5cb +size 110100608 diff --git a/model.per_layer_projection_norm.weight.npy b/model.per_layer_projection_norm.weight.npy new file mode 100644 index 0000000000000000000000000000000000000000..2adc32a5ba025242ef0434c1fd389a7409abb111 --- /dev/null +++ b/model.per_layer_projection_norm.weight.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e30b6e572f69d593ceb9eaa87b6ed445c5219a157c23fdee119f6ef7395ccab +size 1152 diff --git a/post_config.json b/post_config.json new file mode 100644 index 0000000000000000000000000000000000000000..107770a2bfa64d64b299018a432b1b4e7d6a55c5 --- /dev/null +++ b/post_config.json @@ -0,0 +1,11 @@ +{ + "enable_temperature": false, + "temperature": 1.0, + "enable_repetition_penalty": false, + "repetition_penalty": 1.0, + "penalty_window": 64, + "enable_top_p_sampling": false, + "top_p": 0.95, + "enable_top_k_sampling": false, + "top_k": 64 + } diff --git a/serve.sh b/serve.sh new file mode 100644 index 0000000000000000000000000000000000000000..07c8518fc7c845f34bfa9336d8629c2aad696581 --- /dev/null +++ b/serve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Self-contained axllm launcher for this Gemma 4 E4B package. +set -eu +cd "$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +export MALLOC_ARENA_MAX="${MALLOC_ARENA_MAX:-1}" +export MALLOC_TRIM_THRESHOLD_="${MALLOC_TRIM_THRESHOLD_:-131072}" +export MALLOC_MMAP_THRESHOLD_="${MALLOC_MMAP_THRESHOLD_:-131072}" +PORT="${PORT:-18011}" +case " $* " in + *" --port "*) exec ./bin/axllm serve . "$@" ;; + *) exec ./bin/axllm serve . --port "$PORT" "$@" ;; +esac