-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs(index.md): update documentation to reflect changes in FastEmbe…
…d library
- Loading branch information
Showing
1 changed file
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,44 @@ | ||
# Welcome to MkDocs | ||
# FastEmbed | ||
|
||
For full documentation visit [mkdocs.org](https://www.mkdocs.org). | ||
# 🪶 What is FastEmbed? | ||
|
||
## Commands | ||
FastEmbed is lightweight, fast, Python library built for retrieval and easy to use. | ||
|
||
* `mkdocs new [dir-name]` - Create a new project. | ||
* `mkdocs serve` - Start the live-reloading docs server. | ||
* `mkdocs build` - Build the documentation site. | ||
* `mkdocs -h` - Print help message and exit. | ||
|
||
## Project layout | ||
## 🚀 Installation | ||
|
||
mkdocs.yml # The configuration file. | ||
docs/ | ||
index.md # The documentation homepage. | ||
... # Other markdown pages, images and other files. | ||
To install the FastEmbed library, we recommend using Poetry, alternatively -- pip works: | ||
|
||
```bash | ||
pip install fastembed | ||
``` | ||
|
||
## 📖 Usage | ||
|
||
```python | ||
from fastembed.embedding import DefaultEmbedding | ||
|
||
documents: List[str] = [ | ||
"Hello, World!", | ||
"This is an example document.", | ||
"fastembed is supported by and maintained by Qdrant." * 128, | ||
] | ||
embedding_model = DeafultEmbedding() | ||
embeddings: List[np.ndarray] = list(embedding_model.encode(documents)) | ||
``` | ||
|
||
## 🚒 Under the hood | ||
|
||
### Why fast? | ||
|
||
It's important we justify the "fast" in FastEmbed. FastEmbed is fast because: | ||
|
||
1. Quantized model weights | ||
2. ONNX Runtime which allows for inference on CPU, GPU, and other dedicated runtimes | ||
|
||
### Why light? | ||
1. No hidden dependencies on PyTorch or TensorFlow via Huggingface Transformers | ||
|
||
### Why accurate? | ||
1. Better than OpenAI Ada-002 | ||
2. Top of the Embedding leaderboards e.g. [MTEB](https://huggingface.co/spaces/mteb/leaderboard) |