From 1c1f2c6664f4ae424bd5eeea21cdf94e60bafe28 Mon Sep 17 00:00:00 2001 From: Ryan Dick Date: Thu, 22 Aug 2024 16:09:46 +0000 Subject: [PATCH] Add comment about incorrect T5 Tokenizer size calculation. --- invokeai/backend/model_manager/load/model_util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/invokeai/backend/model_manager/load/model_util.py b/invokeai/backend/model_manager/load/model_util.py index 6f93fcbd75..4b8b5a8dde 100644 --- a/invokeai/backend/model_manager/load/model_util.py +++ b/invokeai/backend/model_manager/load/model_util.py @@ -57,6 +57,9 @@ def calc_model_size_by_data(logger: logging.Logger, model: AnyModel) -> int: T5Tokenizer, ), ): + # HACK(ryand): len(model) just returns the vocabulary size, so this is blatantly wrong. It should be small + # relative to the text encoder that it's used with, so shouldn't matter too much, but we should fix this at some + # point. return len(model) else: # TODO(ryand): Promote this from a log to an exception once we are confident that we are handling all of the