知识卡片
模型常驻内存需处理并发初始化
常驻模型可避免每请求反序列化,但首次加载、失败重试和多工作进程会改变资源占用。每个进程可能各持副本,全局变量也不等于进程间共享;需检查启动峰值和一致的模型版本。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
But what resources does the prediction model itself use? This microservice downloads the model from object storage to the variable INTENT_RECOGNIZER_MODEL. The microservice holds this copy of the model in RAM. An alternative to holding it in RAM would be to save the file to disk and load and unload it each time. This would be slower than using RAM:
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》附录E《附录E:容器化微服务部署》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/appendix-e.html)
- 结论依据:摘录中关于模型常驻内存需处理并发初始化的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:But what resources does the prediction model itself use? This microservice downloads the model from object storage to the variable INTENT_RECOGNIZER_MODEL. The microservice holds this copy of the model in RAM. An alternative to holding it in RAM would be to save the file to disk and load and unload it each time. This would be slower than using RAM: