Lost in the Middle: How Language Models Use Long Contexts
Paper
•
2307.03172
•
Published
•
38
Thanks for making this article, It is really easy to follow through and beginner friendly.
In this code, the input= chunk, should be input= query
def retrieve(query, top_n=3):
query_embedding = ollama.embed(model=EMBEDDING_MODEL, input=chunk)['embeddings'][0]