-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add defaults for encoders to openai models #1444
Conversation
@@ -155,6 +157,11 @@ def _format_prompt(self, context, X): | |||
prompt = self.prompt.format(context='\n'.join(context)) | |||
return prompt + X | |||
|
|||
def pre_create(self, db: Datalayer) -> None: | |||
super().pre_create(db) | |||
if isinstance(db.data_backend, IbisDataBackend) and self.encoder is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
db.databackend
@blythed
@@ -15,6 +15,8 @@ | |||
OpenAI as SyncOpenAI, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.encoder: FieldType in the annotation of OpenAI base model
super().pre_create(db) | ||
if isinstance(db.data_backend, IbisDataBackend) and self.encoder is None: | ||
self.encoder = dtype('str') | ||
|
||
@retry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a test as well, because its not tested
duplicate #1447 |
Description
Related Issues
Checklist
make test
successfully?Additional Notes or Comments