|
@@ -1,6 +1,7 @@
|
|
"""
|
|
"""
|
|
@author: luojunhui
|
|
@author: luojunhui
|
|
"""
|
|
"""
|
|
|
|
+import jieba
|
|
from quart import Quart
|
|
from quart import Quart
|
|
from applications.routes import video_score_blueprint
|
|
from applications.routes import video_score_blueprint
|
|
from applications.model_init import Models
|
|
from applications.model_init import Models
|
|
@@ -21,5 +22,14 @@ async def before_serving():
|
|
Models()
|
|
Models()
|
|
|
|
|
|
|
|
|
|
|
|
+@app.before_serving
|
|
|
|
+async def preload_jieba():
|
|
|
|
+ """
|
|
|
|
+ 异步预加载jieba词典
|
|
|
|
+ :return:
|
|
|
|
+ """
|
|
|
|
+ jieba.initialize()
|
|
|
|
+
|
|
|
|
+
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
app.run(debug=True)
|
|
app.run(debug=True)
|