Find answers from the community

Updated 2 months ago

Embeddings

Changed it to this and same error
Plain Text
embed_model = LangchainEmbedding(HuggingFaceEmbeddings())
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.7, model_name="text-curie-001"))
service_context = ServiceContext.from_defaults(embed_model=embed_model, llm_predictor=llm_predictor)
index = GPTSimpleVectorIndex.from_documents(documents, service_context=service_context)
index.save_to_disk('index.json')
index = GPTSimpleVectorIndex.load_from_disk('index.json')
response = index.query("How do i get kudos ?", similarity_top_k=5, mode='embedding', service_context=service_context, optimizer=SentenceEmbeddingOptimizer(percentile_cutoff=0.5))
L
y
11 comments
Does it work if you remove the percentile cutoff? Or passing in the service_context when loading from disk too? (Also no need to set the mode for vector indexes)
Well, you should be able to switch embedding models whenever... but maybe curie isn't made for embeddings lol I never looked into it
I think openai only advertises one model for embeddings 👀
Yeah they used to have several but I think they had consolidated them into one - text-embedding-ada-002
@᲼᲼᲼᲼᲼᲼᲼᲼᲼᲼᲼ you might wanna try this one
tbh i was wanting to use a local one
You can load any model locally from huggingface using this: https://gpt-index.readthedocs.io/en/latest/how_to/customization/embeddings.html#custom-embeddings

By default it's loading https://huggingface.co/sentence-transformers/all-mpnet-base-v2 but you can pass in any model name from huggingface
yeah that's what i did but this + optimizer doesnt work, gonna look into using a local Alpaca or Llama to reduce costs
Add a reply
Sign up and join the conversation on Discord