Update README.md
Browse files
README.md
CHANGED
@@ -21,9 +21,9 @@ model = PeftModel.from_pretrained(model, "hiyouga/baichuan-7b-sft")
|
|
21 |
|
22 |
query = "晚上睡不着怎么办"
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
generate_ids = model.generate(
|
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 |
```
|