wonderwind271 commited on
Commit
8ded30e
·
verified ·
1 Parent(s): 7e006af

bugfix for rehosting

Browse files
Files changed (1) hide show
  1. 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 past_key_values is None:
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}