File size: 383 Bytes
dd8c13e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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 |