We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chat正常有response, 但generate结果打印出来 token_id只比输入多了一个 5, 解码后为空 chat单句推理正常,改成generate进行单句推理/批量推理结果都为空
inputs = self._tokenizer(text_list, padding=True, return_tensors="pt") inputs = inputs.to(self._model.device) outputs = self._model.generate( **inputs, max_length=512, do_sample=False)
两种decode都为空 llm_outputs = list() for j, output in enumerate(outputs.tolist()): index = len(inputs["input_ids"][j]) output1 = output[index:] response = self._tokenizer.decode(output1, skip_special_tokens=True) llm_outputs.append(response)
llm_outputs2 = self._tokenizer.batch_decode(outputs)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is there an existing issue for this?
Current Behavior
chat正常有response, 但generate结果打印出来 token_id只比输入多了一个 5, 解码后为空
chat单句推理正常,改成generate进行单句推理/批量推理结果都为空
inputs = self._tokenizer(text_list, padding=True, return_tensors="pt")
inputs = inputs.to(self._model.device)
outputs = self._model.generate(
**inputs,
max_length=512,
do_sample=False)
两种decode都为空
llm_outputs = list()
for j, output in enumerate(outputs.tolist()):
index = len(inputs["input_ids"][j])
output1 = output[index:]
response = self._tokenizer.decode(output1, skip_special_tokens=True)
llm_outputs.append(response)
llm_outputs2 = self._tokenizer.batch_decode(outputs)
The text was updated successfully, but these errors were encountered: