Commit 02386765 authored by zhouxiang's avatar zhouxiang
Browse files

提交修改token循环统计的问题

parent 5a6298e8
...@@ -101,9 +101,10 @@ int main(int argc, char **argv) { ...@@ -101,9 +101,10 @@ int main(int argc, char **argv) {
} }
if(config.runloop == 1){ if(config.runloop == 1){
static int tokens = 0;
while(true){ while(true){
tokens = 0;
std::vector <std::string> outputs; std::vector <std::string> outputs;
static int tokens = 0;
auto st = std::chrono::system_clock::now(); auto st = std::chrono::system_clock::now();
chatGlm.ResponseBatch(inputs, outputs, [](int index, std::vector <std::string> &contents) { chatGlm.ResponseBatch(inputs, outputs, [](int index, std::vector <std::string> &contents) {
if (index != -1) { if (index != -1) {
...@@ -123,7 +124,7 @@ int main(int argc, char **argv) { ...@@ -123,7 +124,7 @@ int main(int argc, char **argv) {
} }
pid_t pid = getpid(); pid_t pid = getpid();
// printf("batch: %d\n", (int)inputs.size()); // printf("batch: %d\n", (int)inputs.size());
printf("pid %d : output %d tokens\nuse %f s\nspeed = %f tokens / s\n", pid, tokens, spend, tokens / spend); printf("pid %d : output %d tokens, use %f s, speed = %f tokens/s\n", pid, tokens, spend, tokens / spend);
} }
} }
else{ else{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment