Fitness_QA_Bot / models /retrieval.py
lstetson's picture
Upload folder using huggingface_hub
0685af6 verified
raw
history blame contribute delete
282 Bytes
import chromadb
def get_relevant_segments(query, db_path, n_results=5):
client = chromadb.PersistentClient(db_path)
collection= client.get_collection('huberman_videos')
results = collection.query(query_texts=[query], n_results=n_results)
return results