Find answers from the community

Updated last year

Embeddings

At a glance

The community member is looking for an updated example on how to implement a custom embedding model, as the existing example (https://gpt-index.readthedocs.io/en/latest/examples/embeddings/custom_embeddings.html) does not account for some new abstract methods implemented in BaseEmbedding. Another community member responds that there is no updated example, but they can update the existing one. They also suggest checking the source code of some existing embeddings, such as the one from the llama_index library, as a reference. The second community member thanks the first and agrees that the source code is a good example to work from.

Useful resources
Hello, is there an updated example on how to implement a custom embedding model? Looks like there are a few new abstract methods implemented in BaseEmbedding that aren't accounted for in the example (https://gpt-index.readthedocs.io/en/latest/examples/embeddings/custom_embeddings.html). Thanks!
L
a
2 comments
Good catch -- no updated example, but I can update that example!

You could also check out the source could from some existing embeddings

https://github.com/jerryjliu/llama_index/blob/main/llama_index/embeddings/langchain.py
Thanks, that source code is a perfect example to work off of.
Add a reply
Sign up and join the conversation on Discord