polished
This commit is contained in:
parent
d4dea3bc0a
commit
51f4a8c9d0
@ -2,8 +2,8 @@ import lancedb
|
||||
import config, embedding
|
||||
db = lancedb.connect(config.memories_db_path)
|
||||
table = db.open_table(config.memories_table)
|
||||
question = "Email group Microsoft tidak muncul, apakah masuk spam?"
|
||||
query_vector = embedding.embed_text(question)
|
||||
question = "cara mengecek spam di outlook"
|
||||
query_vector = embedding.embed_text(config.model_url, config.model_name, question)
|
||||
results = (
|
||||
table.search(query_vector, vector_column_name="vector_title")
|
||||
.limit(3)
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
requests
|
||||
lancedb
|
||||
pyarrow
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import lancedb
|
||||
import embedding
|
||||
import config, embedding
|
||||
db = lancedb.connect(config.memories_db_path)
|
||||
table = db.open_table(config.memories_table)
|
||||
docs = [
|
||||
@ -34,7 +34,7 @@ for doc in docs:
|
||||
"id" : doc["id" ],
|
||||
"title" : doc["title" ],
|
||||
"story" : doc["story" ],
|
||||
"vector_title" : embedding.embed_text(doc["title"]),
|
||||
"vector_title" : embedding.embed_text(config.model_url, config.model_name, doc["title"]),
|
||||
}
|
||||
table.add([row])
|
||||
print(f"Menambahkan record: {doc['title']}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user