Merge remote-tracking branch 'songquanpeng/main'
# Conflicts: # controller/relay-text.go
This commit is contained in:
commit
5c3f42b4f7
@ -12,14 +12,16 @@ total_time=0
|
|||||||
times=()
|
times=()
|
||||||
|
|
||||||
for ((i=1; i<=count; i++)); do
|
for ((i=1; i<=count; i++)); do
|
||||||
result=$(curl -o /dev/null -s -w %{time_total}\\n \
|
result=$(curl -o /dev/null -s -w "%{http_code} %{time_total}\\n" \
|
||||||
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": "gpt-3.5-turbo", "stream": false, "max_tokens": 1}')
|
||||||
echo "$result"
|
http_code=$(echo "$result" | awk '{print $1}')
|
||||||
total_time=$(bc <<< "$total_time + $result")
|
time=$(echo "$result" | awk '{print $2}')
|
||||||
times+=("$result")
|
echo "HTTP status code: $http_code, Time taken: $time"
|
||||||
|
total_time=$(bc <<< "$total_time + $time")
|
||||||
|
times+=("$time")
|
||||||
done
|
done
|
||||||
|
|
||||||
average_time=$(echo "scale=4; $total_time / $count" | bc)
|
average_time=$(echo "scale=4; $total_time / $count" | bc)
|
||||||
|
Loading…
Reference in New Issue
Block a user