Torus.Embeddings.PostgresML (Torus v0.5.2)
View SourceTorus.Embeddings.PostgresML
uses PostgreSQL PostgresML extension to generate embeddings. It allows you to generate embeddings using a variety of models and performs inference directly in the database. This would require your database to have GPU support.
To use it, add the following to your config.exs
:
config :torus, embedding_module: Torus.Embeddings.PostgresML
config :torus, Torus.Embeddings.PostgresML, repo: YourApp.Repo
By default, it uses sentence-transformers/all-MiniLM-L6-v2
model, but you can specify a different model by explicitly passing model
to the config:
config :torus, Torus.Embeddings.PostgresML, model: "your/model"
Read more about in PostgresML.
See Torus.semantic/5
on how to use this module to introduce semantic search in your application.