mirror of
https://github.com/p-e-w/heretic.git
synced 2026-06-02 05:03:33 +02:00
fix: address ty complaint
This commit is contained in:
@@ -743,7 +743,12 @@ class Model:
|
|||||||
max_new_tokens=4096,
|
max_new_tokens=4096,
|
||||||
) # ty:ignore[call-non-callable]
|
) # ty:ignore[call-non-callable]
|
||||||
|
|
||||||
return self.tokenizer.decode(
|
# This cast is valid because str is the return type
|
||||||
outputs[0, inputs["input_ids"].shape[1] :],
|
# when passing a sequence of token IDs.
|
||||||
skip_special_tokens=True,
|
return cast(
|
||||||
|
str,
|
||||||
|
self.tokenizer.decode(
|
||||||
|
outputs[0, inputs["input_ids"].shape[1] :],
|
||||||
|
skip_special_tokens=True,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user