# FIXME: Fix this bug. Sometimes, some top_logprobs are missing in the return value.
# FIXME: Sometimes, some top_logprobs are missing in the return value. The reason is that some out_put id maps to the same output token and duplicate in the map
# assert ret_num_top_logprobs == logprobs, f"{ret_num_top_logprobs} vs {logprobs}"
# assert ret_num_top_logprobs == logprobs, f"{ret_num_top_logprobs} vs {logprobs}"
@@ -90,12 +116,15 @@ class TestOpenAIServer(unittest.TestCase):
...
@@ -90,12 +116,15 @@ class TestOpenAIServer(unittest.TestCase):
ret_num_top_logprobs=len(
ret_num_top_logprobs=len(
response.choices[0].logprobs.top_logprobs[0]
response.choices[0].logprobs.top_logprobs[0]
)
)
# FIXME: Fix this bug. Sometimes, some top_logprobs are missing in the return value.
# FIXME: Sometimes, some top_logprobs are missing in the return value. The reason is that some out_put id maps to the same output token and duplicate in the map
# assert ret_num_top_logprobs == logprobs, f"{ret_num_top_logprobs} vs {logprobs}"
# assert ret_num_top_logprobs == logprobs, f"{ret_num_top_logprobs} vs {logprobs}"
assertret_num_top_logprobs>0
iffirst:
iffirst:
ifecho:
ifecho:
assertresponse.choices[0].text.startswith(prompt)
assertresponse.choices[0].text.startswith(
prompt
),f"{response.choices[0].text} and all args {echo}{logprobs}{token_input}{first}"
first=False
first=False
assertresponse.id
assertresponse.id
...
@@ -104,7 +133,7 @@ class TestOpenAIServer(unittest.TestCase):
...
@@ -104,7 +133,7 @@ class TestOpenAIServer(unittest.TestCase):