----translation-----
I use self.tokenizer.convert_tokens_to_ids to try to convert the text_feat output of the model to input_id and then to text, as follows:
But the output keeps getting wrong, either all [PAD] or all [100, 100]. I checked the value of the Token and found that they were not the same, I felt that there was something wrong with my code and I wanted to know what the right thing to do should be.
我使用
self.tokenizer.convert_tokens_to_ids
尝试将模型输出的text_feat转化为input_id进而转化为文本,代码如下所示:但是输出结果一直有误,要么全部得到[PAD],或者得到[100, 100]。我检查了Token的值,发现他们并不一样,我觉得是我代码出了问题,我想知道正确的做法应该是什么。
----translation----- I use
self.tokenizer.convert_tokens_to_ids
to try to convert the text_feat output of the model to input_id and then to text, as follows:But the output keeps getting wrong, either all [PAD] or all [100, 100]. I checked the value of the Token and found that they were not the same, I felt that there was something wrong with my code and I wanted to know what the right thing to do should be.