koboldcpp/conversion
Xuan-Son Nguyen 6e62ba5384
mtmd: support pocket-tts (#26871)
* adapt the api

* text model ok

* working impl, need verify and clean up

* mtmd: build the pocket-tts transposed convolutions as GEMM + col2im

ggml_conv_transpose_1d has no grouped mode, so the depthwise upsample
was built as one convolution and one concat per channel, which floods
the graph with small nodes and makes kernel launches dominate the
decoder.

Fold both cases into the column form the seanet decoder already needs:
the general case reshapes the kernel to [IC, K * OC] and matmuls it
with the input, the depthwise case batches a matmul over the channels
so a step scales its own kernel. A single col2im_1d then scatter-adds
the columns back to the signal, with the same shape as before, so the
overlap-add tail, the streaming state and the bias are untouched.

Generation time per frame drops by 80% on CUDA and by 50% on CPU. The
output matches the previous implementation sample for sample, with a
correlation of 0.999994 and identical frame counts.

* flow_temp +  frames_after_eos

* chunking

* mtmd: carry the remaining pocket-tts per-pack settings

The language packs also tune the end-of-speech padding and the padding
of short prompts, next to the temperature already carried in the
mmproj: french_24l asks for 8 tail frames instead of the guessed 3,
english_2026-01 asks for short prompts to be padded with spaces.

Write both in the mmproj as clip.gen.audio.frames_after_eos and
clip.gen.audio.pad_short_text, keyed on the pack in the conversion
script like the temperature. The loader keeps them optional, so a
mmproj without them behaves as before. Map semicolons to commas for
every pack instead, the reference only asks for it on three of them and
it costs nothing elsewhere.

Existing mmproj files must be converted again to carry the two keys.

On a long french text the port now lands within 2% of the reference:
22.96s against 23.44s, with the same peak level and the same amount of
silence.

* clip.gen.audio.model_variant

* clean up code comments

* nit: drop the dead flow_temp hparam, the pack table holds the default

* update docs

* address security problems

* less invasive base.py

* lint

* add mtmd_gen_inp_default

* add docs

* rm gen_flow_temp

---------

Co-authored-by: Pascal <admin@serveurperso.com>
2026-08-11 14:18:30 +02:00
..
__init__.py mtmd: support pocket-tts (#26871) 2026-08-11 14:18:30 +02:00
afmoe.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
arctic.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
baichuan.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
bailingmoe.py convert : more consistent handling of rope_parameters (#24833) 2026-06-20 13:42:36 +03:00
base.py mtmd: support pocket-tts (#26871) 2026-08-11 14:18:30 +02:00
bert.py conversion: fix non-MoE NomicBert GGUF conversion error (#25996) 2026-07-23 11:01:35 +08:00
bitnet.py conversion: accept BitNetForCausalLM architecture name (#25769) 2026-07-16 16:24:47 +03:00
bloom.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
chameleon.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
chatglm.py convert : import bytes_to_unicode from convert_slow_tokenizer (#26217) 2026-08-04 10:34:30 +03:00
codeshell.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
cogvlm.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
command_r.py Add arch support for cohere2-MoE (#24260) 2026-06-13 19:49:00 +02:00
dbrx.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
deci.py convert : more consistent handling of rope_parameters (#24833) 2026-06-20 13:42:36 +03:00
deepseek.py convert : fix DeepseekV4 rope parameters with transformers 5.x (#26673) 2026-08-06 16:06:52 +03:00
dots1.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
dotsocr.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
dream.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
ernie.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
exaone.py convert : accept "ExaoneMoeForCausalLM" arch spelling (#26660) 2026-08-06 18:56:04 +08:00
falcon.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
falcon_h1.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
gemma.py convert : more consistent handling of rope_parameters (#24833) 2026-06-20 13:42:36 +03:00
glm.py model : support MTP in GLM-4.7-Flash (#24868) 2026-08-03 20:27:52 +02:00
gpt2.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
gpt_oss.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
gptneox.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
granite.py model : Granite-Switch Architecture (#25107) 2026-08-10 09:53:46 +02:00
grok.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
grovemoe.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
hunyuan.py convert: fix handle HunyuanVL XD-RoPE config (#25514) 2026-07-22 00:42:35 +02:00
internlm.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
internvl.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
jais.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
jamba.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
januspro.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
kimi_linear.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
kimivl.py mtmd: add GLM-5.2-Vision (#26126) 2026-07-26 20:43:51 +02:00
laguna.py Add support for Laguna XS.2 & M.1 (#25165) 2026-07-22 09:54:08 +08:00
lfm2.py model : Add LFM2.5-ColBERT-350M and LFM2.5-Embedding-350M (#24913) 2026-06-24 09:49:46 +03:00
lighton_ocr.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
llada.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
llama.py convert : add missing return after setting tekken vocab (#25947) 2026-08-04 11:41:18 +03:00
llama4.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
llava.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
maincoder.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
mamba.py mamba2: remove hardcoded 2x expansion factor and invalid d_inner % d_state check (#23082) 2026-06-26 08:50:54 +03:00
mellum.py model: add Mellum architecture (#23966) 2026-06-02 22:11:12 +03:00
mimo.py mtmd: support MiMo-V2.5 audio input (RVQ-based model) (#26190) 2026-07-27 23:17:09 +02:00
minicpm.py mtmd: add minicpmv46 downsample (#25993) 2026-08-01 13:38:36 +02:00
minimax.py mtmd: Add Vision Support for Minimax-M3 (#25113) 2026-07-27 01:44:41 +02:00
mistral.py convert : fix conversion for Mistral-Medium-3.5-128B (#24268) 2026-06-07 21:41:39 +02:00
mistral3.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
mpt.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
muse_glimmer.py model: Muse Glimmer Support (#26841) 2026-08-10 13:07:27 +02:00
nanbeige.py model: Add support for Nanbeige4.2 (#25994) 2026-07-27 17:04:18 +02:00
nemotron.py model: add MTP support for Nemotron model (#26725) 2026-08-10 11:25:24 +03:00
olmo.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
openelm.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
orion.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
pangu.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
phi.py convert : more consistent handling of rope_parameters (#24833) 2026-06-20 13:42:36 +03:00
pixtral.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
plamo.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
plm.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
pockettts.py mtmd: support pocket-tts (#26871) 2026-08-11 14:18:30 +02:00
qwen.py convert : import bytes_to_unicode from convert_slow_tokenizer (#26217) 2026-08-04 10:34:30 +03:00
qwen3tts.py mtmd: support Qwen3-TTS (note: breaking change to llama-tts binary) (#26254) 2026-08-04 17:26:15 +02:00
qwen3vl.py convert : fix Qwen3 ASR conversion (#23081) 2026-05-15 18:38:39 +02:00
qwenvl.py conversion: fix Qwen2.5-Omni mmproj conversion regression (#26262) 2026-07-29 12:53:44 +02:00
refact.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
rwkv.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
sarashina2.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
smallthinker.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
smolvlm.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
stablelm.py convert : more consistent handling of rope_parameters (#24833) 2026-06-20 13:42:36 +03:00
starcoder.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
step3.py convert_hf_to_gguf: support split MTP export for HY V3 (#25641) 2026-07-14 11:43:15 +02:00
t5.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
talkie.py model : add support for talkie-1930-13b (#22596) 2026-05-26 07:57:38 +03:00
ultravox.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
wavtokenizer.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
xverse.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
youtuvl.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00