File size: 544 Bytes
ef233f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from ragatouille import RAGPretrainedModel

myrag = RAGPretrainedModel.from_index("ragatouille/colbert/indexes/cofindex_vector_db_nosplit/")


def get_similar_profiles(profile, prefix, rag_engine = myrag, k=20):
  query = prefix + profile
  raw_results = rag_engine.search(str(query), k=k)
  results = []
  for result in raw_results:
    if result["content"] == profile:
        print("ah")
    else:
      results.append(result["content"])
    final_md = ""
    for result in results:
        final_md += "### " + result[1:]
  return final_md