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

cause oom #5

Open
Xuwenee opened this issue May 19, 2022 · 1 comment
Open

cause oom #5

Xuwenee opened this issue May 19, 2022 · 1 comment

Comments

@Xuwenee
Copy link

Xuwenee commented May 19, 2022

Full.Tokenize may cause OOM(out of memery), such as: text="suvZR∨"

@UchihaArk
Copy link

UchihaArk commented Jul 28, 2023

I also encountered the same problem,text="Cr⁶", this code endless loop
tokenize/wordpiece.go line45

for len(tok) > 0 && tok != "##" {
	sub := wp.vocab.LongestSubstring(tok)
	if sub == "" {
		toks = append(toks, wp.unknownToken)
		break
	}
	toks = append(toks, sub)
	tok = fmt.Sprintf("##%s", tok[len(sub):])
}

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