diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index 90c2b7094c..5287c4df94 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -6658,7 +6658,7 @@ class BertModel(TextModel): tokens: list[bytes] = [f"[PAD{i}]".encode("utf-8") for i in range(vocab_size)] scores: list[float] = [-10000.0] * vocab_size - toktypes: list[int] = [SentencePieceTokenTypes.UNUSED] * vocab_size # ty: ignore[invalid-assignment] + toktypes: list[int] = [SentencePieceTokenTypes.UNUSED] * vocab_size if isinstance(tokenizer, SentencePieceProcessor): for token_id in range(tokenizer.vocab_size()): diff --git a/scripts/jinja/jinja-tester.py b/scripts/jinja/jinja-tester.py index 4f79b8da3d..a83f025411 100755 --- a/scripts/jinja/jinja-tester.py +++ b/scripts/jinja/jinja-tester.py @@ -20,6 +20,7 @@ from PySide6.QtCore import Qt, QRect, QSize from jinja2 import TemplateSyntaxError from jinja2.sandbox import ImmutableSandboxedEnvironment from datetime import datetime +from typing import Callable def format_template_content(template_content): @@ -395,7 +396,7 @@ class JinjaTester(QMainWindow): ensure_ascii=ensure_ascii, ) ) - env.globals["strftime_now"] = lambda format: datetime.now().strftime(format) # ty: ignore[invalid-assignment] + env.globals["strftime_now"]: Callable[[str], str] = lambda format: datetime.now().strftime(format) env.globals["raise_exception"] = raise_exception # ty: ignore[invalid-assignment] try: template = env.from_string(template_str)