You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for key, value in state_dict.items():
# FIX: Check if the weight uses the new Gemma 4 multimodal prefix
if key.startswith("model.language_model."):
# Map back to the flat structure expected by the text-only class
new_key = key.replace("model.language_model.", "model.")
new_state_dict[new_key] = value
else:
new_state_dict[key] = value
model.load_state_dict(new_state_dict)
--- FIX FOR gemma/model.py ---
def load_weights(model, weights_path):
state_dict = torch.load(weights_path)
new_state_dict = {}