Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6a34813b
authored
Jul 04, 2023
by
mrhaoji
Committed by
GitHub
Jul 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: add model parameter to the time_test script (#245)
default value is gpt-3.5-turbo
parent
3b247077
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
bin/time_test.sh
+5
-3
No files found.
bin/time_test.sh
View file @
6a34813b
#!/bin/bash
#!/bin/bash
if
[
$#
-
ne
3
]
;
then
if
[
$#
-
lt
3
]
;
then
echo
"Usage: time_test.sh <domain> <key> <count>"
echo
"Usage: time_test.sh <domain> <key> <count>
[<model>]
"
exit
1
exit
1
fi
fi
domain
=
$1
domain
=
$1
key
=
$2
key
=
$2
count
=
$3
count
=
$3
model
=
${
4
:-
"gpt-3.5-turbo"
}
# 设置默认模型为 gpt-3.5-turbo
total_time
=
0
total_time
=
0
times
=()
times
=()
...
@@ -16,7 +18,7 @@ for ((i=1; i<=count; i++)); do
...
@@ -16,7 +18,7 @@ for ((i=1; i<=count; i++)); do
https://
"
$domain
"
/v1/chat/completions
\
https://
"
$domain
"
/v1/chat/completions
\
-H
"Content-Type: application/json"
\
-H
"Content-Type: application/json"
\
-H
"Authorization: Bearer
$key
"
\
-H
"Authorization: Bearer
$key
"
\
-d
'{"messages": [{"content": "echo hi", "role": "user"}], "model": "
gpt-3.5-turbo
", "stream": false, "max_tokens": 1}'
)
-d
'{"messages": [{"content": "echo hi", "role": "user"}], "model": "
'
"
$model
"
'
", "stream": false, "max_tokens": 1}'
)
http_code
=
$(
echo
"
$result
"
| awk
'{print $1}'
)
http_code
=
$(
echo
"
$result
"
| awk
'{print $1}'
)
time
=
$(
echo
"
$result
"
| awk
'{print $2}'
)
time
=
$(
echo
"
$result
"
| awk
'{print $2}'
)
echo
"HTTP status code:
$http_code
, Time taken:
$time
"
echo
"HTTP status code:
$http_code
, Time taken:
$time
"
...
...
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