support echo=true and logprobs in openai api when logprobs=1 in lm-evaluation-harness (#1998)
This commit is contained in:
1 parent
b808a38365
commit
027e65248f
2 files changed
+8
-2
No files matched your search
@@ -85,7 +85,9 @@ class TestOpenAIServer(unittest.TestCase):
|
||||
# assert ret_num_top_logprobs == logprobs, f"{ret_num_top_logprobs} vs {logprobs}"
|
||||
assert ret_num_top_logprobs > 0
|
||||
|
||||
assert response.choices[0].logprobs.token_logprobs[0]
|
||||
# when echo=True and request.logprobs>0, logprob_start_len is 0, so the first token's logprob would be None.
|
||||
if not echo:
|
||||
assert response.choices[0].logprobs.token_logprobs[0]
|
||||
|
||||
assert response.id
|
||||
assert response.created
|
||||
|
||||
Reference in new issue
Block a user