diff --git a/gptc/classifier.py b/gptc/classifier.py index 2b655b3..4929b0c 100755 --- a/gptc/classifier.py +++ b/gptc/classifier.py @@ -20,26 +20,9 @@ class Classifier: """ def __init__(self, model): - try: - model_version = model["__version__"] - except: - model_version = 1 - - if model_version == 3: - self.model = model - else: - # The model is an unsupported version - try: - raw_model = model["__raw__"] - except: - raise gptc.exceptions.UnsupportedModelError( - "this model is unsupported and does not contain a raw model for recompiling" - ) - - warnings.warn( - "model needed to be recompiled on-the-fly; please re-compile it and use the new compiled model in the future" - ) - self.model = gptc.compiler.compile(raw_model) + if model.get("__version__", 0) != 3: + raise gptc.exceptions.UnsupportedModelError(f"unsupported model version") + self.model = model def confidence(self, text): """Classify text with confidence. diff --git a/gptc/compiler.py b/gptc/compiler.py index e4fe87b..83f6b99 100755 --- a/gptc/compiler.py +++ b/gptc/compiler.py @@ -60,6 +60,5 @@ def compile(raw_model): model["__names__"] = names model["__version__"] = 3 - model["__raw__"] = raw_model return model