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

初始化时的预加载 #24

Open
remind0 opened this issue Jul 27, 2021 · 2 comments
Open

初始化时的预加载 #24

remind0 opened this issue Jul 27, 2021 · 2 comments

Comments

@remind0
Copy link

remind0 commented Jul 27, 2021

如果把该系统集成到线上系统,为了确保模型的响应速度,最好能显式在整个后台跑起来时就能预加载会用到的模块,如何实现?
类似于jieba提供的:jieba.initialize(),会直接加载模型,确保后续调用时不需要重新加载,更快响应。

@dongrixinyu
Copy link
Owner

所有的功能都会在第一次调用的时候自动预加载,也就是第一次响应会慢。此后加载在内存里,不会重新加载,速度不受影响。

@dongrixinyu
Copy link
Owner

jio.parse_location._prepare()或者 jio.parse_time._preprocess()应该是你想要的。不过名字没有统一,后续可以考虑统一

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