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
OpenDAS
opencompass
Commits
88c14d3d
Unverified
Commit
88c14d3d
authored
May 24, 2024
by
bittersweet1999
Committed by
GitHub
May 24, 2024
Browse files
add support for lmdeploy api judge (#1193)
parent
749e4cea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
opencompass/models/openai_api.py
opencompass/models/openai_api.py
+6
-2
No files found.
opencompass/models/openai_api.py
View file @
88c14d3d
...
@@ -184,8 +184,12 @@ class OpenAI(BaseAPIModel):
...
@@ -184,8 +184,12 @@ class OpenAI(BaseAPIModel):
messages
.
append
(
msg
)
messages
.
append
(
msg
)
# Hold out 100 tokens due to potential errors in tiktoken calculation
# Hold out 100 tokens due to potential errors in tiktoken calculation
max_out_len
=
min
(
try
:
max_out_len
,
context_window
-
self
.
get_token_len
(
str
(
input
))
-
100
)
max_out_len
=
min
(
max_out_len
,
context_window
-
self
.
get_token_len
(
str
(
input
))
-
100
)
except
KeyError
:
max_out_len
=
max_out_len
if
max_out_len
<=
0
:
if
max_out_len
<=
0
:
return
''
return
''
...
...
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