Skip to content

Commit

Permalink
Fix for termination issue (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
akxlr authored May 13, 2024
1 parent 0ca21bd commit 4871fc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/inference/inference_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def generate_prompt(instruction):
generation_output = model.generate(
input_ids = inputs["input_ids"].to(device),
attention_mask = inputs['attention_mask'].to(device),
eos_token_id=tokenizer.eos_token_id,
eos_token_id=terminators,
pad_token_id=tokenizer.eos_token_id,
generation_config = generation_config
)
Expand All @@ -215,4 +215,4 @@ def generate_prompt(instruction):
with open(dirname+'/generation_config.json','w') as f:
json.dump(generation_config,f,ensure_ascii=False,indent=2)
else:
generation_config.save_pretrained('./')
generation_config.save_pretrained('./')

0 comments on commit 4871fc1

Please sign in to comment.