Find answers from the community

Updated 5 months ago

Custom models

At a glance
hey all, i had a notebook running with flan and hugginf_face embeddings as:

Plain Text
hfemb = HuggingFaceEmbeddings()
embed_model = LangchainEmbedding(hfemb)

and then
Plain Text
index = GPTSimpleVectorIndex.from_documents(documents, embed_model=embed_model, llm_predictor=llm_predictor)

but I believe that usage of embed_model is deprecated? or else what am I missing?
L
t
5 comments
You'll want to set llm_predictor and embed_model inside the service context object, and then pass the service context object into the index constructor πŸ‘
Partial example here with the llm predictor
(Also note that flans max input size is 512, so adjust the prompt helper accordingly)
Oh nice thanks I'll try that
Add a reply
Sign up and join the conversation on Discord