Skip to content

Commit

Permalink
fix readme and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Feb 10, 2024
1 parent a23d6c7 commit 3d6af2f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions integrations/fastembed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ pip install fastembed-haystack
You can use `FastembedTextEmbedder` and `FastembedDocumentEmbedder` by importing as:

```python
from fastembed_haystack.fastembed_text_embedder import FastembedTextEmbedder
from haystack_integrations.components.embedders.fastembed import FastembedTextEmbedder

text = "fastembed is supported by and maintained by Qdrant."
text_embedder = FastembedTextEmbedder(
model="BAAI/bge-small-en-v1.5"
)
embedding = text_embedder.run(text)
text_embedder.warm_up()
embedding = text_embedder.run(text)["embedding"]
```

```python
from fastembed_haystack.fastembed__document_embedder import FastembedDocumentEmbedder
from haystack_integrations.components.embedders.fastembed import FastembedDocumentEmbedder
from haystack.dataclasses import Document

embedder = FastembedDocumentEmbedder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FastembedDocumentEmbedder:
# To use this component, install the "fastembed-haystack" package.
# pip install fastembed-haystack
from fastembed_haystack.fastembed__document_embedder import FastembedDocumentEmbedder
from haystack_integrations.components.embedders.fastembed import FastembedDocumentEmbedder
from haystack.dataclasses import Document
doc_embedder = FastembedDocumentEmbedder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ class FastembedTextEmbedder:
Usage example:
```python
# To use this component, install the "fastembed" package.
# pip install fastembed
# To use this component, install the "fastembed-haystack" package.
# pip install fastembed-haystack
from fastembed_haystack.fastembed_text_embedder import FastembedTextEmbedder
from haystack_integrations.components.embedders.fastembed import FastembedTextEmbedder
text = "It clearly says online this will work on a Mac OS system. The disk comes and it does not, only Windows. Do Not order this if you have a Mac!!"
text_embedder = FastembedTextEmbedder(
model="BAAI/bge-small-en-v1.5"
)
text_embedder.warm_up()
embedding = text_embedder.run(text)
embedding = text_embedder.run(text)["embedding"]
```
""" # noqa: E501

Expand Down

0 comments on commit 3d6af2f

Please sign in to comment.