feat: Add basic text generation support with native models, initially supporting Gemma3 (#12392)

This commit is contained in:
Jukka Seppänen
2026-02-19 03:49:43 +02:00
committed by GitHub
parent f262444dd4
commit 6d11cc7354
9 changed files with 502 additions and 33 deletions

View File

@ -1418,3 +1418,11 @@ def deepcopy_list_dict(obj, memo=None):
memo[obj_id] = res
return res
def normalize_image_embeddings(embeds, embeds_info, scale_factor):
"""Normalize image embeddings to match text embedding scale"""
for info in embeds_info:
if info.get("type") == "image":
start_idx = info["index"]
end_idx = start_idx + info["size"]
embeds[:, start_idx:end_idx, :] /= scale_factor