From e6ec689cb157531adf5913c4266bcbcc7fb78c31 Mon Sep 17 00:00:00 2001 From: zhaodongsheng Date: Mon, 1 Jul 2024 16:30:41 +0800 Subject: [PATCH] (fix) token get error and python version note (#1311) --- benchmark/benchmark.md | 3 ++- benchmark/benchmark.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/benchmark/benchmark.md b/benchmark/benchmark.md index a14c355c5..351c87a20 100644 --- a/benchmark/benchmark.md +++ b/benchmark/benchmark.md @@ -5,7 +5,8 @@ 批量自动化测试问答对话测试,支持单轮问答测试。 ## 使用说明 -注意:建议在开发测试环境的执行,如果需要在生产环境的测试,请避开用户使用高峰期。 +- 注意1:建议在开发测试环境的执行,如果需要在生产环境的测试,请避开用户使用高峰期。 +- 注意2: python版本要求3.8可以运行。3.8.5版本测试通过。以上python版本未测试。 1. 准备测试问题 将问题写入`test_data.csv`文件,格式如下: diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 538c5df49..81dfeea43 100644 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -62,7 +62,7 @@ class BatchTest: # secret 请和 com.tencent.supersonic.auth.api.authentication.config.AuthenticationConfig.tokenAppSecret 保持一致 secret = "WIaO9YRRVt+7QtpPvyWsARFngnEcbaKBk783uGFwMrbJBaochsqCH62L4Kijcb0sZCYoSsiKGV/zPml5MnZ3uQ==" exp = time.time() + 100000000 - token= jwt.encode({"token_userName": userName,"exp": exp}, secret, algorithm="HS512") + token= jwt.encode({"token_user_name": userName,"exp": exp}, secret, algorithm="HS512") return token