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 @@ from __future__ import annotations
import json
import re
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, List
from typing import TYPE_CHECKING, Any
import torch
@@ -273,7 +273,7 @@ class GrammarConfig:
return re.sub(r'(["\\])', r'\\\1', s)
@staticmethod
def choice_as_grammar(choice: List[str] | None) -> str:
def choice_as_grammar(choice: list[str] | None) -> str:
if choice is None:
raise ValueError("Choice is not set")
escaped_choices = (GrammarConfig.escape_ebnf_string(c) for c in choice)