[Misc] Streamline unique id generation (#29375)
Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
@@ -52,9 +52,11 @@ STR_FLASHINFER_ATTN_VAL: str = "FLASHINFER"
|
||||
STR_FLASH_ATTN_VAL: str = "FLASH_ATTN"
|
||||
STR_INVALID_VAL: str = "INVALID"
|
||||
|
||||
MASK_64_BITS = (1 << 64) - 1
|
||||
|
||||
|
||||
def random_uuid() -> str:
|
||||
return str(uuid.uuid4().hex)
|
||||
return f"{uuid.uuid4().int & MASK_64_BITS:016x}" # 16 hex chars
|
||||
|
||||
|
||||
def length_from_prompt_token_ids_or_embeds(
|
||||
|
||||
Reference in New Issue
Block a user