baichuan-inc / Baichuan-7B

A large-scale 7B pretraining language model developed by BaiChuan-Inc.
https://huggingface.co/baichuan-inc/baichuan-7B
Apache License 2.0
5.67k stars 506 forks source link

[Question] output为什么要包含input呢 #104

Open ghost opened 1 year ago

ghost commented 1 year ago

Required prerequisites

Questions

`>>> prompt = "Hey, are you consciours? Can you talk to me?"

inputs = tokenizer(prompt, return_tensors="pt")

Generate

generate_ids = model.generate(inputs.input_ids, max_length=30) tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0] "Hey, are you consciours? Can you talk to me?\nI'm not consciours, but I can talk to you."` 看到官方示例中output中是包含了input内容的,感觉会损失推理速度,请问为什么要这么做呢?能不能微调成只输出response的内容呢?

Checklist