[fix] Clamp logprob with dtype min to prevent -inf (#3224)

This commit is contained in:
Byron Hsu
2025-01-31 01:04:04 -08:00
committed by GitHub
parent 3ee62235c6
commit 734daedd8f
2 changed files with 8 additions and 6 deletions

View File

@@ -36,7 +36,7 @@ class TestBatchPenalizerE2E(unittest.TestCase):
def run_decode(
self,
return_logprob=True,
top_logprobs_num=3,
top_logprobs_num=5,
return_text=True,
n=1,
**sampling_params,
@@ -58,8 +58,7 @@ class TestBatchPenalizerE2E(unittest.TestCase):
"logprob_start_len": 0,
},
)
print(json.dumps(response.json()))
print("=" * 100)
assert response.status_code == 200, "Request failed: " + response.text
def test_default_values(self):
self.run_decode()
@@ -112,4 +111,4 @@ class TestBatchPenalizerE2E(unittest.TestCase):
if __name__ == "__main__":
unittest.main()
unittest.main(verbosity=3)