Remove ability to directly use raw models
This commit is contained in:
parent
212e8c0304
commit
8d2e64e09b
18
gptc/gptc.py
18
gptc/gptc.py
|
@ -64,26 +64,18 @@ class Classifier:
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
model : dict or list
|
model : dict
|
||||||
A compiled or raw GPTC model. Please don't use raw models except
|
A compiled GPTC model.
|
||||||
during development.
|
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
----------
|
----------
|
||||||
model : dict
|
model : dict
|
||||||
The model used. This is always a compiled model.
|
The model used.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, model, supress_uncompiled_model_warning=False):
|
def __init__(self, model):
|
||||||
if type(model) == dict:
|
self.model = model
|
||||||
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 classify(self, text):
|
def classify(self, text):
|
||||||
"""Classify text.
|
"""Classify text.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user