From 19cdf7e2440d4a315be6cb89d70c73f317326fa2 Mon Sep 17 00:00:00 2001 From: Philipp Emanuel Weidmann Date: Sun, 15 Mar 2026 09:58:00 +0530 Subject: [PATCH] fix: address ty complaint --- src/heretic/model.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/heretic/model.py b/src/heretic/model.py index 0511d3b..c2bda92 100644 --- a/src/heretic/model.py +++ b/src/heretic/model.py @@ -743,7 +743,12 @@ class Model: max_new_tokens=4096, ) # ty:ignore[call-non-callable] - return self.tokenizer.decode( - outputs[0, inputs["input_ids"].shape[1] :], - skip_special_tokens=True, + # This cast is valid because str is the return type + # when passing a sequence of token IDs. + return cast( + str, + self.tokenizer.decode( + outputs[0, inputs["input_ids"].shape[1] :], + skip_special_tokens=True, + ), )