mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
add support for lmdeploy api judge (#1193)
This commit is contained in:
parent
749e4cea71
commit
88c14d3d04
@ -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
|
||||||
|
try:
|
||||||
max_out_len = min(
|
max_out_len = min(
|
||||||
max_out_len, context_window - self.get_token_len(str(input)) - 100)
|
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 ''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user