hiyouga commited on
Commit
1b98b3a
1 Parent(s): b71b1cd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -21,9 +21,9 @@ model = PeftModel.from_pretrained(model, "hiyouga/baichuan-7b-sft")
21
 
22
  query = "晚上睡不着怎么办"
23
 
24
- inputs_ids = tokenizer(["<human>:{}\n<bot>:".format(query)], return_tensors="pt")["input_ids"]
25
- inputs_ids = inputs_ids.to("cuda")
26
- generate_ids = model.generate(input_ids)
27
  output = tokenizer.batch_decode(generate_ids)[0]
28
  print(output)
29
  ```
 
21
 
22
  query = "晚上睡不着怎么办"
23
 
24
+ inputs = tokenizer(["<human>:{}\n<bot>:".format(query)], return_tensors="pt")
25
+ inputs = inputs_ids.to("cuda")
26
+ generate_ids = model.generate(**inputs)
27
  output = tokenizer.batch_decode(generate_ids)[0]
28
  print(output)
29
  ```