Update some more deprecated type hinting (#17998)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-05-12 23:49:33 +00:00
committed by GitHub
parent acee8f48aa
commit 9d7ea9dbbf
10 changed files with 73 additions and 73 deletions
@@ -6,7 +6,7 @@ import os
from enum import Enum
from json import dumps as json_dumps
from re import escape as regex_escape
from typing import Optional, Tuple, Union
from typing import Optional, Union
from transformers import PreTrainedTokenizerBase
@@ -111,7 +111,7 @@ def get_local_outlines_guided_decoding_logits_processor(
def _get_guide_and_mode(
guided_params: GuidedDecodingParams
) -> Union[Tuple[str, GuidedDecodingMode], Tuple[None, None]]:
) -> Union[tuple[str, GuidedDecodingMode], tuple[None, None]]:
if guided_params.json:
if isinstance(guided_params.json, dict):
# turn dict into hashable string