From 867277531b21f33c4ec3ec36673f0c00f041867c Mon Sep 17 00:00:00 2001 From: davidmezzetti <561939+davidmezzetti@users.noreply.github.com> Date: Tue, 18 Aug 2020 15:08:51 -0400 Subject: [PATCH] Updated README, minor comment update --- README.md | 22 ++++++++++++++++++---- src/python/txtai/embeddings.py | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e89c769de..a99062b79 100644 --- a/README.md +++ b/README.md @@ -34,16 +34,30 @@ You can also install txtai directly from GitHub. Using a Python Virtual Environm Python 3.6+ is supported -### Notes for Windows -This project has dependencies that require compiling native code. Linux environments usually work without an issue. Windows requires the following extra steps. +### Troubleshooting +This project has dependencies that require compiling native code. Windows and macOS systems require the following additional steps. Most Linux environments will install without any additional steps. + +#### Windows - Install C++ Build Tools - https://visualstudio.microsoft.com/visual-cpp-build-tools/ -- If PyTorch errors are encountered, run the following command before installing paperai. See [pytorch.org](https://pytorch.org) for more information. +- PyTorch binaries are not on pip, the following url link must be added when installing + + ``` + pip install txtai -f https://download.pytorch.org/whl/torch_stable.html + ``` + + See [pytorch.org](https://pytorch.org) for more information. + +#### macOS + +- Run the following before installing ``` - pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html + brew install libomp ``` + See [this link](https://github.com/kyamagu/faiss-wheels#prerequisite) for more information. + ## Examples The examples directory has a series of examples and notebooks giving an overview of txtai. See the list of notebooks below. diff --git a/src/python/txtai/embeddings.py b/src/python/txtai/embeddings.py index 3f92bb55e..90cbff208 100644 --- a/src/python/txtai/embeddings.py +++ b/src/python/txtai/embeddings.py @@ -97,11 +97,11 @@ def index(self, documents): # Normalize embeddings self.normalize(embeddings) - # Save configuration + # Save embeddings metadata self.config["ids"] = ids self.config["dimensions"] = dimensions - # Create embeddings index, store backend used + # Create embeddings index self.embeddings = ANN.create(self.config) # Build the index