[Ci/Build] Fix mypy errors on main (#12296)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung 2025-01-22 12:06:54 +08:00 committed by GitHub
parent 016e3676e7
commit cbdc4ad5a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,7 +43,7 @@ class PromptReplacementDetails:
"""
@staticmethod
def from_seq(seq: _PromptSeq):
def from_seq(seq: _PromptSeq) -> "PromptReplacementDetails":
return PromptReplacementDetails(full=seq, features=seq)
@ -132,7 +132,10 @@ class _BoundPromptSequence:
_token_ids: Optional[list[int]]
@staticmethod
def from_seq(tokenizer: AnyTokenizer, seq: _PromptSeq):
def from_seq(
tokenizer: AnyTokenizer,
seq: _PromptSeq,
) -> "_BoundPromptSequence":
return _BoundPromptSequence(
tokenizer=tokenizer,
_text=seq if isinstance(seq, str) else None,