From b246d17513465e3bc3718c7f7fd7269b575c608d Mon Sep 17 00:00:00 2001 From: Maya <48323879+mayaeary@users.noreply.github.com> Date: Fri, 31 Mar 2023 14:20:31 +0300 Subject: [PATCH] Fix `type object is not subscriptable` Fix `type object is not subscriptable` on python 3.8 --- modules/callbacks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/callbacks.py b/modules/callbacks.py index aa92f9cb..945b8c37 100644 --- a/modules/callbacks.py +++ b/modules/callbacks.py @@ -12,7 +12,7 @@ import modules.shared as shared # Copied from https://github.com/PygmalionAI/gradio-ui/ class _SentinelTokenStoppingCriteria(transformers.StoppingCriteria): - def __init__(self, sentinel_token_ids: list[torch.LongTensor], starting_idx: int): + def __init__(self, sentinel_token_ids: list, starting_idx: int): transformers.StoppingCriteria.__init__(self) self.sentinel_token_ids = sentinel_token_ids self.starting_idx = starting_idx