Skip to content

Commit

Permalink
Merge pull request #3 from eltociear/patch-1
Browse files Browse the repository at this point in the history
Update modeling_opt.py
  • Loading branch information
lsh0520 authored Mar 22, 2024
2 parents 5b6a793 + c4785e9 commit a38b243
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/modeling_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,13 +920,13 @@ def forward(
>>> model = OPTForCausalLM.from_pretrained("facebook/opt-350m")
>>> tokenizer = AutoTokenizer.from_pretrained("facebook/opt-350m")
>>> prompt = "Hey, are you consciours? Can you talk to me?"
>>> prompt = "Hey, are you conscious? Can you talk to me?"
>>> inputs = tokenizer(prompt, return_tensors="pt")
>>> # Generate
>>> generate_ids = model.generate(inputs.input_ids, max_length=30)
>>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
"Hey, are you consciours? Can you talk to me?\nI'm not consciours, but I can talk to you."
"Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
```"""

output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
Expand Down

0 comments on commit a38b243

Please sign in to comment.