News for hackers. Stuff that matters.
Re:MiniLM-L6-v2 maps paragraphs to 384 dimension vector for ... by rahimnathwani on Tuesday March 21, 2023 @02:54PM (#35250793)
Yesterday I read about this embedding model that can be run locally.

I read about it here: https://news.ycombinator.com/item?id=35236275

But it's been mentioned on HN a few times in the past 3 months:

https://news.ycombinator.com/item?id=35055808

https://news.ycombinator.com/item?id=34691307

https://news.ycombinator.com/item?id=34034940

https://news.ycombinator.com/item?id=34007942

It can be used as am embedding model in llama_index (fka gpt_index). Here's a code snippet from one of their users:

  from langchain.embeddings.huggingface import HuggingFaceEmbeddings
  from llama_index import LangchainEmbedding

  def get_embed_model():
      model_name = "sentence-transformers/all-MiniLM-L6-v2"
      embed_model = LangchainEmbedding(HuggingFaceEmbeddings(model_name=model_name))
      return embed_model

  get_embed_model()

  index = GPTSimpleVectorIndex(documents, embed_model=embed_model)

There are no comments on this comment yet.