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

Fix issues when loadmodel from model file which contains Unicode #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

leti367
Copy link
Member

@leti367 leti367 commented Jul 19, 2022

This issue happens when there are Unicode characters exist in model file name. To test it I simply modified the nuget test project, updates the model file name from "bert_base_tok.bin" to "bert_base_tok★.bin". Then when we run the test we got the exception:
"
Model File Name is: ./bin/Debug/net6.0/bert_base_tokΓÿà.bin
Unhandled exception. System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at BlingFire.BlingFireUtils.LoadModel(Byte[] modelName)
"

setlocale(LC_ALL, ".UTF8") fixes this issue. I've tested it on x64-windows ,arm64-windows, osx-arm64. will do more testes on other platforms.

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

Successfully merging this pull request may close these issues.

2 participants