You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to work on #55 a bit and ran into some other issues.
Calling any GPT classifier like below raises errors for key and org.
clf = ZeroShotGPTClassifier(model="gpt-3.5-turbo")
clf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'ZeroShotGPTClassifier' object has no attribute 'org'
Expected behavior:
clf
ZeroShotGPTClassifier()
The likely cause is how you handle the key and org. You define key and org attributes in the ZeroShotGPTClassifier innit but then set them using _set_keys from the GPTMixin. GPTMixin, however creates 2 new attributes called openai_key and openai_org, the original attributes are never set.
The same issue arrises with FewShot, Dynamic and GPTVectorizer.
The easiest fix would be to do some refactoring in the GPTMixin.
The text was updated successfully, but these errors were encountered:
Hi, @iryna-kondr the culprit is the BaseEstimator from scikit-learn. According to this scikit-learn documentation (excerpt below) the get_params function looks at the innit parameters and not necessarilly the attributes we assign in the function itself. The set_params function constructs a dict of the innit parameters.
"All scikit-learn estimators have get_params and set_params functions. The get_params function takes no arguments and returns a dict of the init parameters of the estimator, together with their values."
I was trying to work on #55 a bit and ran into some other issues.
Calling any GPT classifier like below raises errors for key and org.
Expected behavior:
The likely cause is how you handle the key and org. You define key and org attributes in the ZeroShotGPTClassifier innit but then set them using _set_keys from the GPTMixin. GPTMixin, however creates 2 new attributes called openai_key and openai_org, the original attributes are never set.
The same issue arrises with FewShot, Dynamic and GPTVectorizer.
The easiest fix would be to do some refactoring in the GPTMixin.
The text was updated successfully, but these errors were encountered: