Browse Source

增加单句多篇幅检测

master
majiahui@haimaqingfan.com 2 years ago
parent
commit
d2000b12df
  1. 10
      flask_check_bert_test.py

10
flask_check_bert_test.py

@ -992,9 +992,9 @@ def classify(): # 调用模型,设置最大batch_size
return_text = {"resilt": return_list, "probabilities": None, "status_code": 200}
load_result_path = "./new_data_logs/{}.json".format(query_id)
load_result_path = "./new_data_logs/{}.json".format(queue_uuid)
print("query_id: ", query_id)
print("queue_uuid: ", queue_uuid)
print("load_result_path: ", load_result_path)
with open(load_result_path, 'w', encoding='utf8') as f2:
@ -1002,10 +1002,10 @@ def classify(): # 调用模型,设置最大batch_size
# indent=2 JSON数据的缩进,美观
json.dump(return_text, f2, ensure_ascii=False, indent=4)
print(query_id)
print(queue_uuid)
print(load_result_path)
redis_.set(query_id, load_result_path, 86400)
redis_.srem(db_key_querying, query_id)
redis_.set(queue_uuid, load_result_path, 86400)
redis_.srem(db_key_querying, queue_uuid)
@app.route("/", methods=["POST"])

Loading…
Cancel
Save