yuewang-sf
commited on
Commit
•
4481e2d
1
Parent(s):
e8086d7
Update README.md
Browse files
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 |
-
|
36 |
-
|
|
|
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 |
|