[Fix] Fix logprob and normalized_logprob (#1428)

This commit is contained in:
Lianmin Zheng authored and GitHub committed 2024-09-15 06:36:06 -07:00
1 parent 282681b8a1
commit 9ba1f09760
22 files changed
+314 -215

No files matched your search

@@ -239,9 +239,12 @@ class RuntimeEndpoint(BaseBackend):
# Compute logprob
data = {
"text": [s.text_ + c for c in choices],
"sampling_params": {"max_new_tokens": 0},
"sampling_params": {
"max_new_tokens": 0,
"temperature": 0,
},
"return_logprob": True,
"logprob_start_len": max(prompt_len - 2, 0),
"logprob_start_len": max(prompt_len - 2, 0), # for token healing
}
obj = self._generate_http_request(s, data)
+1 -1
View File
@@ -9,7 +9,7 @@ import uuid
import warnings
from concurrent.futures import ThreadPoolExecutor
from contextlib import contextmanager
from typing import Any, Callable, Dict, List, Optional, Union
from typing import Any, Callable, Dict, List, Optional
import tqdm