Skip to content

Commit

Permalink
update demo code in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan Zhang committed Oct 23, 2024
1 parent 9ac1ccc commit 2851090
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ logits_processor = LogitsProcessorList([
outputs = model.generate(
pos_inputs.input_ids.to("cuda:0"),
GENERATION_CONFIG,
logits_processor=logits_processor
logits_processor=logits_processor,
attention_mask=pos_inputs.attention_mask.to("cuda:0"),
)

mm_list = processor.decode(outputs[0])
Expand Down Expand Up @@ -212,6 +213,7 @@ GENERATION_CONFIG = GenerationConfig(
outputs = model.generate(
inputs.input_ids.to("cuda:0"),
GENERATION_CONFIG,
attention_mask=pos_inputs.attention_mask.to("cuda:0"),
)

outputs = outputs[:, inputs.input_ids.shape[-1]:]
Expand Down

0 comments on commit 2851090

Please sign in to comment.