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
encoder.py这个文件中的vec是str类型,vec.detach()这样写会报错,请问作者这里是不是去掉detach()
def get_bert_vec(self, text, text_mask, text_pos=None): if text_pos is None: _, _, text_vecs = self.bert(text, text_mask) else: _, _, text_vecs = self.bert(text, text_mask, position_ids=text_pos) text_vecs = list(text_vecs) if self.detach_ptm_flag: for i, vec in enumerate(text_vecs): text_vecs[i] = vec.detach() return text_vecs
The text was updated successfully, but these errors were encountered:
这是transformers的版本问题,我用的是transformers 3.0.2
Sorry, something went wrong.
No branches or pull requests
def get_bert_vec(self, text, text_mask, text_pos=None):
if text_pos is None:
_, _, text_vecs = self.bert(text, text_mask)
else:
_, _, text_vecs = self.bert(text, text_mask, position_ids=text_pos)
text_vecs = list(text_vecs)
if self.detach_ptm_flag:
for i, vec in enumerate(text_vecs):
text_vecs[i] = vec.detach()
return text_vecs
The text was updated successfully, but these errors were encountered: