简体   繁体   English

使用烧瓶服务 pytorch 模型

[英]serving pytorch model using flask

If multiple clients make a request to one server(pytorch model), how does the problem arise in the multithread of the flask or elsewhere?如果多个客户端向一台服务器(pytorch 模型)发出请求,那么问题是如何在烧瓶的多线程或其他地方出现的?

As far as I know, if running the pytorch model with multithreading using flask, the data will get tangled.据我所知,如果使用烧瓶运行多线程的 pytorch 模型,数据会很纠结。 If I'm wrong, please correct it.如果我错了,请纠正它。

"

Use a multithreaded approach for Flask<\/code> as well, the request will get throttled if you just initiate a single threaded usual Flask<\/code> server.Flask<\/code>也使用多线程方法,如果您只是启动一个单线程的常用Flask<\/code>服务器,请求将受到限制。

Use Gunicorn<\/code> : https:\/\/gunicorn.org\/<\/a> to start your Flask server, with a good number of threads, passed as a parameter value to Gunicorn<\/code> .使用Gunicorn<\/code> : https<\/a> :\/\/gunicorn.org\/ 启动您的 Flask 服务器,使用大量线程,作为参数值传递给Gunicorn<\/code> 。

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM