[fix] Clamp logprob with dtype min to prevent -inf (#3224)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user