Created
December 11, 2025 22:58
-
-
Save davidmezzetti/f78cf793a8b96169497008d3d34d120f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from txtai import Embeddings | |
| # Load the 100K most viewed Wikipedia articles | |
| embeddings = Embeddings() | |
| embeddings.load(provider="huggingface-hub", container="neuml/txtai-wikipedia-slim") | |
| # Show a random article | |
| embeddings.search(""" | |
| SELECT id, text, 'https://en.wikipedia.org/wiki/' || replace(id, ' ', '_') url | |
| FROM txtai | |
| ORDER BY RANDOM() | |
| LIMIT 1 | |
| """) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment