Update modeling_molmoe.py
Browse filesUpdating `modelling_molmo.py` MolmoE inspired from the fix in https://huggingface.co/allenai/Molmo-7B-D-0924/discussions/41
- modeling_molmoe.py +1 -2
modeling_molmoe.py
CHANGED
@@ -2468,8 +2468,7 @@ class MolmoForCausalLM(PreTrainedModel):
|
|
2468 |
del model_kwargs["images"]
|
2469 |
del model_kwargs["image_masks"]
|
2470 |
del model_kwargs["image_input_idx"]
|
2471 |
-
|
2472 |
-
model_kwargs[cache_name] = cache
|
2473 |
model_kwargs["cache_position"] = model_kwargs["cache_position"][-1:] + num_new_tokens
|
2474 |
return model_kwargs
|
2475 |
|
|
|
2468 |
del model_kwargs["images"]
|
2469 |
del model_kwargs["image_masks"]
|
2470 |
del model_kwargs["image_input_idx"]
|
2471 |
+
model_kwargs["past_key_values"] = outputs.past_key_values
|
|
|
2472 |
model_kwargs["cache_position"] = model_kwargs["cache_position"][-1:] + num_new_tokens
|
2473 |
return model_kwargs
|
2474 |
|