From 8d2e64e09b47fbe40a841081991a40c1b508b54f Mon Sep 17 00:00:00 2001 From: kj7rrv Date: Tue, 26 Oct 2021 10:04:10 -0700 Subject: [PATCH] Remove ability to directly use raw models --- gptc/gptc.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/gptc/gptc.py b/gptc/gptc.py index c09d338..f76b12c 100755 --- a/gptc/gptc.py +++ b/gptc/gptc.py @@ -64,26 +64,18 @@ class Classifier: Parameters ---------- - model : dict or list - A compiled or raw GPTC model. Please don't use raw models except - during development. + model : dict + A compiled GPTC model. Attributes ---------- model : dict - The model used. This is always a compiled model. + The model used. """ - def __init__(self, model, supress_uncompiled_model_warning=False): - if type(model) == dict: - self.model = model - else: - self.model = compile(model) - if not supress_uncompiled_model_warning: - print('WARNING: model was not compiled', file=sys.stderr) - print('This makes everything slow, because compiling models takes far longer than using them.', file=sys.stderr) - self.warn = supress_uncompiled_model_warning + def __init__(self, model): + self.model = model def classify(self, text): """Classify text.