Closed shell-nlp closed 1 year ago
result = tokenizer( prompt, truncation=True, max_length=max_len, padding=False, return_tensors=None, ) 为什么result的input 没有 bos 和 eos 标志 而且 result["attention_mask"].append(1) 报错 提示result["attention_mask"]为numpy类型 [[Fasle,.........True],[False,False,False...False]]
你提到的这些和本项目无关,huggingface tokenizer中,需要传入add_special_tokens才会自动添加bos, eos, tokenize后的结果,返回结果的具体信息等,建议看huggingface tokenizer 部分文档。
result = tokenizer( prompt, truncation=True, max_length=max_len, padding=False, return_tensors=None, ) 为什么result的input 没有 bos 和 eos 标志 而且 result["attention_mask"].append(1) 报错 提示result["attention_mask"]为numpy类型 [[Fasle,.........True],[False,False,False...False]]