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 cohere embedding function #550

Merged
merged 6 commits into from
Oct 13, 2023
Merged

Add cohere embedding function #550

merged 6 commits into from
Oct 13, 2023

Conversation

AyushExel
Copy link
Contributor

No description provided.

@@ -12,6 +12,7 @@
# limitations under the License.


from .cohere import CohereEmbeddingFunction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth separating out the existing embedding functions into their own modules? e.g., openai.py, openclip.py, sentence_transformers.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think so. The scope and size of the file functions.py will become too large otherwise.

python/lancedb/embeddings/cohere.py Outdated Show resolved Hide resolved
python/lancedb/embeddings/cohere.py Outdated Show resolved Hide resolved
python/lancedb/embeddings/cohere.py Show resolved Hide resolved

def ndims(self):
if self._ndims is None:
self._ndims = len(self.generate_embeddings(["foo"])[0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this requires a remote api call which is a bit unfortunate. Can we just hard code it for now like we do with openai?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. But what does this accomplish tho? If a user uses a different model, won't hardcoding error out?

python/lancedb/embeddings/cohere.py Show resolved Hide resolved
@AyushExel AyushExel merged commit 683824f into main Oct 13, 2023
6 checks passed
@AyushExel AyushExel deleted the embedding_apis branch October 13, 2023 10:57
raghavdixit99 pushed a commit to raghavdixit99/lancedb that referenced this pull request Apr 5, 2024
westonpace pushed a commit that referenced this pull request Apr 5, 2024
alexkohler pushed a commit to alexkohler/lancedb that referenced this pull request Apr 20, 2024
build all features

Co-authored-by: Chang She <759245+changhiskhan@users.noreply.github.com>
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.

None yet

2 participants