External vectors
See original GitHub issueFirst of all, thank you for adding this feature!
I am attempting to recreate the example locally from the docs:
import numpy as np
import requests
from txtai.embeddings import Embeddings
data = ['test', 'test2']
def transform(inputs):
response = requests.post("https://api-inference.huggingface.co/pipeline/feature-extraction/sentence-transformers/nli-mpnet-base-v2",
json={"inputs": inputs})
return np.array(response.json(), dtype=np.float32)
# Index data using vectors from Inference API
embeddings = Embeddings({"method": "external", "transform": transform, "content": True})
embeddings.index([(uid, text, None) for uid, text in enumerate(data)])
print("%-20s %s" % ("Query", "Best Match"))
print("-" * 50)
print(embeddings.search('test', 1))
when I run the search, I receive an empty array. Perhaps data must be a tuple?
Issue Analytics
- State:
- Created a year ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
internal and external divison of vectors - UrbanPro
Vector is that quantity that has direction and magnitude for example force, velocity, acceleration and displacement The scaler is that quantity ...
Read more >External Vector Art, Icons, and Graphics for Free Download
Browse 1929 incredible External vectors, icons, clipart graphics, and backgrounds for royalty-free download from the creative contributors at Vecteezy!
Read more >Exterior algebra - Wikipedia
is called a bivector and lives in a space called the exterior square, a vector space that is distinct from the original space...
Read more >External Images | Free Vectors, Stock Photos & PSD
Find & Download Free Graphic Resources for External. 6000+ Vectors, Stock Photos & PSD files. ✓ Free for commercial use ✓ High Quality...
Read more >Section Formula In Vector Algebra - Line Segment - Byju's
The point R can divide the line segment PQ in two ways: internally and externally. Let us consider both these cases individually. Case...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @bramses
I see the settings here use external vectors but faiss is the default ANN storage engine. When external vectors are used, it just uses the transform function to vectorize text but vectors are still stored internally.
Did you intend to have data stored externally?
Worked like a charm!!!