WangZeJun commited on
Commit
4bd2a92
1 Parent(s): 6e19446

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -2
README.md CHANGED
@@ -21,8 +21,9 @@ input_ids = input_ids.cuda()
21
  outputs = model.generate(input_ids, do_sample=True, max_new_tokens=1024, top_p=0.85,
22
  temperature=0.3, repetition_penalty=1.2, eos_token_id=tokenizer.eos_token_id)
23
 
24
- output = tokenizer.decode(outputs[0])
25
- response = output.replace(text, "").replace('</s>', "")
 
26
  print(response)
27
  ```
28
 
 
21
  outputs = model.generate(input_ids, do_sample=True, max_new_tokens=1024, top_p=0.85,
22
  temperature=0.3, repetition_penalty=1.2, eos_token_id=tokenizer.eos_token_id)
23
 
24
+ input_ids_len = input_ids.size(1)
25
+ response_ids = outputs[0][input_ids_len:]
26
+ response = tokenizer.decode(response_ids)
27
  print(response)
28
  ```
29