Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/cactus/convert/cactus_adapters/tensor_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def save_tensor_with_header(tensor, output_path, precision='INT8', transpose=Fal
data = data * GEMMA4_WEIGHT_SCALE
elif 'router_scale' in filename:
data = data / GEMMA4_WEIGHT_SCALE
elif filename in ('token_embeddings.weights', 'output_weight.weights', 'embed_vision_embedding.weights', 'embed_vision_proj.weights'):
elif filename in ('token_embeddings.weights', 'output_weight.weights', 'embed_vision_proj.weights', 'embed_audio_proj.weights'):
data = data / GEMMA4_WEIGHT_SCALE
elif filename == 'output_norm.weights':
data = data * GEMMA4_WEIGHT_SCALE
Expand Down
1 change: 0 additions & 1 deletion python/cactus/convert/model_adapters/naming.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class NameMatch:
GEMMA4_DIV_BASENAMES = {
"token_embeddings",
"output_weight",
"embed_vision_embedding",
}


Expand Down
4 changes: 0 additions & 4 deletions python/cactus/transpile/model_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,10 +1094,6 @@ def _gemma4_compute_native_like_audio_features(
if not callable(getattr(embed_audio, "forward", None)):
raise TypeError("Gemma4 audio embedder is not callable")
projected = embed_audio(inputs_embeds=audio_encodings)
# Native Cactus Gemma4 scales audio soft tokens before merging them into
# the language stream. HF leaves this implicit in its fp16 path, but the
# quantized Cactus decoder expects the native-scaled representation.
projected = projected * (1.0 / 16.0)
# The transpiled bundle is shape-specialized from representative media.
# Native Gemma4 audio preprocessing emits an unpadded feature tensor for
# that media, so the post-subsampling sequence is already the real token
Expand Down
Loading