Skip to content

Commit e901c69

Browse files
remove redudant funciton
1 parent e87ba81 commit e901c69

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

eval_protocol/adapters/lp_deserializer.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def _parse_header(raw: bytes) -> Dict[str, Any]:
4949
}
5050

5151

52-
def _parse_logprobs_raw(raw: bytes) -> Tuple[List[float], Optional[List[int]], Dict[str, Any]]:
52+
def parse_logprobs(raw: bytes) -> Tuple[List[float], Optional[List[int]], Dict[str, Any]]:
53+
"""Parse uncompressed LP/v1 bytes into logprobs, optional token ids, and metadata."""
5354
header = _parse_header(raw)
5455
token_count = header["token_count"]
5556
body_byte_length = header["body_byte_length"]
@@ -90,11 +91,6 @@ def _parse_logprobs_raw(raw: bytes) -> Tuple[List[float], Optional[List[int]], D
9091
return logprobs, ids_out, header
9192

9293

93-
def parse_logprobs(raw: bytes) -> Tuple[List[float], Optional[List[int]], Dict[str, Any]]:
94-
"""Parse uncompressed LP/v1 bytes into logprobs, optional token ids, and metadata."""
95-
return _parse_logprobs_raw(raw)
96-
97-
9894
def decompress_and_parse_lp(data_b64: str) -> Tuple[List[float], Optional[List[int]], Dict[str, Any]]:
9995
"""Decompress and unpack an LP/v1 payload into completion logprobs and token ids.
10096
@@ -110,4 +106,4 @@ def decompress_and_parse_lp(data_b64: str) -> Tuple[List[float], Optional[List[i
110106
compressed = base64.b64decode(data_b64)
111107
decompressor = zstd.ZstdDecompressor()
112108
raw = decompressor.decompress(compressed)
113-
return _parse_logprobs_raw(raw)
109+
return parse_logprobs(raw)

0 commit comments

Comments
 (0)