yuewang-sf commited on
Commit
4481e2d
1 Parent(s): e8086d7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -2
README.md CHANGED
@@ -32,8 +32,9 @@ model = AutoModelForSeq2SeqLM.from_pretrained(checkpoint,
32
  low_cpu_mem_usage=True,
33
  trust_remote_code=True).to(device)
34
 
35
- inputs = tokenizer.encode("def print_hello():", return_tensors="pt").to(device)
36
- outputs = model.generate(inputs, max_length=12)
 
37
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
38
  ```
39
 
 
32
  low_cpu_mem_usage=True,
33
  trust_remote_code=True).to(device)
34
 
35
+ encoding = tokenizer("def print_hello_world():", return_tensors="pt").to(device)
36
+ encoding['decoder_input_ids'] = encoding['input_ids'].clone()
37
+ outputs = model.generate(**encoding, max_length=15)
38
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
39
  ```
40