bugfix for rehosting
Browse files- modeling_minicpm.py +1 -1
modeling_minicpm.py
CHANGED
@@ -1486,7 +1486,7 @@ class MiniCPMForCausalLM(MiniCPMPreTrainedModel):
|
|
1486 |
position_ids = position_ids[:, -input_ids.shape[1] :]
|
1487 |
|
1488 |
# if `inputs_embeds` are passed, we only want to use them in the 1st generation step
|
1489 |
-
if inputs_embeds is not None and
|
1490 |
model_inputs = {"inputs_embeds": inputs_embeds}
|
1491 |
else:
|
1492 |
model_inputs = {"input_ids": input_ids}
|
|
|
1486 |
position_ids = position_ids[:, -input_ids.shape[1] :]
|
1487 |
|
1488 |
# if `inputs_embeds` are passed, we only want to use them in the 1st generation step
|
1489 |
+
if inputs_embeds is not None and past_length==0:
|
1490 |
model_inputs = {"inputs_embeds": inputs_embeds}
|
1491 |
else:
|
1492 |
model_inputs = {"input_ids": input_ids}
|