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

I guess this is a bug... #295

Closed
beyondguo opened this issue Jun 4, 2022 · 1 comment
Closed

I guess this is a bug... #295

beyondguo opened this issue Jun 4, 2022 · 1 comment

Comments

@beyondguo
Copy link

input_text = 'label_{} {}'.format(label, self.sep_token)

Orig:

input_text = 'label_{} {}'.format(label, self.sep_token)

I believe it should be:

input_text = '{} {}'.format(label, self.sep_token)

Because the original input format mismatches the format in the pre-processing script:

def prepare_mlm_data(labels, texts, output_file_path, sep_token):
	if not os.path.exists(output_file_path):
		os.makedirs(output_file_path)
	with open(os.path.join(output_file_path, 'mlm_data.txt'), 'w') as f:
		for label, text in zip(labels, texts):
			f.write(' '.join([str(label), sep_token, text]) + '\n')

I have tried to generate samples by your code, but the generated text is very strange. After I made the changes above, the results become normal.

@makcedward
Copy link
Owner

You are right. This fix will be included in the coming release

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