Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

blythed
Copy link
Collaborator

@blythed blythed commented Dec 2, 2023

Description

Related Issues

Checklist

  • Is this code covered by new or existing unit tests or integration tests?
  • Did you run make test successfully?
  • Do new classes, functions, methods and parameters all have docstrings?
  • Were existing docstrings updated, if necessary?
  • Was external documentation updated, if necessary?

Additional Notes or Comments

@jieguangzhou jieguangzhou mentioned this pull request Dec 3, 2023
5 tasks
@@ -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:
Copy link
Contributor

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,
Copy link
Contributor

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
Copy link
Contributor

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

@thejumpman2323
Copy link
Contributor

duplicate #1447

@blythed blythed deleted the bug/api-encoders branch June 1, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants