PRIYANSHUDHAKED's picture
Create database.py
dd8c13e verified
raw
history blame contribute delete
383 Bytes
import lancedb
def get_db():
db = lancedb.connect("lancedb")
return db
def insert_video_data(video_data):
db = get_db()
table = db.create_table("videos", video_data)
table.add(video_data)
def search_similar_videos(query, limit=5):
db = get_db()
table = db.open_table("videos")
results = table.search(query).limit(limit).to_list()
return results