File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change 3
3
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
4
4
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
5
5
6
- import hashlib
7
6
import os
8
7
from typing import Any , Optional
9
8
@@ -129,26 +128,11 @@ def create_request(
129
128
) -> Request :
130
129
"""Make dummy request for testing."""
131
130
global _none_hash_initialized
132
-
133
- # Create a hash function that returns bytes instead of int
134
- def bytes_hash (data ):
135
- """Hash function that returns bytes instead of int."""
136
- if isinstance (data , (list , tuple )):
137
- # Convert list/tuple to string representation, then encode to bytes
138
- data_str = str (data )
139
- elif isinstance (data , str ):
140
- data_str = data
141
- else :
142
- data_str = str (data )
143
-
144
- # Use hashlib to create a consistent bytes hash
145
- return hashlib .sha256 (data_str .encode ('utf-8' )).digest ()[:8 ] # Use first 8 bytes
146
-
147
131
if not _none_hash_initialized :
148
- init_none_hash (bytes_hash )
132
+ init_none_hash (hash )
149
133
_none_hash_initialized = True
150
134
151
- block_hasher = get_request_block_hasher (block_size , bytes_hash )
135
+ block_hasher = get_request_block_hasher (block_size , hash )
152
136
153
137
kv_transfer_params : Optional [dict [str , Any ]] = None
154
138
You can’t perform that action at this time.
0 commit comments