From 69da5b7bc2bf72479f79c4f84d0d4e2419869ec2 Mon Sep 17 00:00:00 2001 From: Gnome Ann <> Date: Sat, 28 May 2022 23:44:19 -0400 Subject: [PATCH] Update list of transformers versions that have broken OPT --- aiserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aiserver.py b/aiserver.py index 0c1c5b95..2737cd69 100644 --- a/aiserver.py +++ b/aiserver.py @@ -26,6 +26,7 @@ import json import collections import zipfile import packaging +import packaging.version import contextlib import traceback import threading @@ -1348,7 +1349,7 @@ if(not vars.use_colab_tpu and vars.model not in ["InferKit", "Colab", "OAI", "Go # Fix a bug in OPTForCausalLM where self.lm_head is the wrong size - if(transformers_version == "4.19.0"): + if(packaging.version.parse("4.19.0.dev0") <= packaging.version.parse(transformers_version) <= packaging.version.parse("4.19.2")): try: from transformers import OPTForCausalLM, OPTModel except ImportError: