HarderThenHarder / transformers_tasks

⭐️ NLP Algorithms with transformers lib. Supporting Text-Classification, Text-Generation, Information-Extraction, Text-Matching, RLHF, SFT etc.
https://www.zhihu.com/column/c_1451236880973426688
2.11k stars 376 forks source link

发现错误的代码 #82

Open Victoria-aaaaaa opened 11 months ago

Victoria-aaaaaa commented 11 months ago

if 'token_type_ids' in tokenized_output: # 兼容不需要 token_type_id 的模型, e.g. Roberta-Base if 'token_type_ids' not in tokenized_output: tokenized_output['token_type_ids'] = [encoded_inputs['token_type_ids']] else: tokenized_output['token_type_ids'].append(encoded_inputs['token_type_ids']) 大佬您好,看到units.py里的这段代码应该有一些问题,希望您看一下是否需要删除if 'token_type_ids' in tokenized_output:这行代码

wwwwwwwwwwwwwwwang commented 4 months ago

我这儿也出错,请问您解决了这个问题了吗,怎么解决的呀