diff --git a/README.md b/README.md index 08740e6..6b91c5d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ bash run_api.sh "http://192.168.31.74:12000/predict" { - "texts": "User:你好\nAssistant:" + "texts": "你好" } ## 返回示例 ## 请求参数 diff --git a/flask_predict.py b/flask_predict.py index e019bf0..906de2d 100644 --- a/flask_predict.py +++ b/flask_predict.py @@ -34,6 +34,7 @@ batch_size = 32 @app.route("/predict", methods=["POST"]) def handle_query(): text = request.json["texts"] # 获取用户query中的文本 例如"I love you" + text = f"User:{text}\nAssistant:" id_ = str(uuid.uuid1()) # 为query生成唯一标识 d = {'id': id_, 'text': text} # 绑定文本和query id redis_.rpush(db_key_query, json.dumps(d)) # 加入redis diff --git a/yuce3.py b/yuce3.py index bc99d5d..2ff1599 100644 --- a/yuce3.py +++ b/yuce3.py @@ -35,7 +35,7 @@ text = "User:生成目录#\n问:为论文题目《基于跨文化意识培养 nums = 10 nums = int(nums) -url = "http://192.168.31.74:18001/predict" +url = "http://192.168.31.74:12000/predict" input_data = [] for i in range(nums):