Skip to content
New issue

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

encode() got an unexpected keyword argument 'max_length' #10

Open
32209056 opened this issue May 17, 2024 · 3 comments
Open

encode() got an unexpected keyword argument 'max_length' #10

32209056 opened this issue May 17, 2024 · 3 comments

Comments

@32209056
Copy link

请问一下,token_ids,mask = self.tokenizer.encode(
d['text'], max_length=self.max_len)这段代码报错,怎么修改

File "/ddnstor/imu_tzt1/sulisha/GRTE-main/main.py", line 48, in iter
d['text'], max_length=self.max_len
TypeError: encode() got an unexpected keyword argument 'max_length'

@AcademicChamberlain
Copy link

AcademicChamberlain commented May 20, 2024

改成 token_ids, mask = self.tokenizer.encode(d['text'], maxlen=self.max_len) 试试

@32209056
Copy link
Author

改成 token_ids, mask = self.tokenizer.encode(d['text'], maxlen=self.max_len) 试试

谢谢,已改通

@AcademicChamberlain
Copy link

AcademicChamberlain commented May 24, 2024

改成 token_ids, mask = self.tokenizer.encode(d['text'], maxlen=self.max_len) 试试

谢谢,已改通

不客气~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants