Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ChatGLM-6B_fastllm
Commits
02386765
Commit
02386765
authored
Sep 01, 2023
by
zhouxiang
Browse files
提交修改token循环统计的问题
parent
5a6298e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
benchmark/benchmark.cpp
benchmark/benchmark.cpp
+3
-2
No files found.
benchmark/benchmark.cpp
View file @
02386765
...
@@ -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
\n
use %f s
\n
speed = %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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment