Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Update demo script

davidmezzettib5f4c3cfe34d
diff --git a/examples/demo.py b/examples/demo.py
index 4dbe77b5..4e8a1c37 100644
--- a/examples/demo.py
+++ b/examples/demo.py
@@ -4,8 +4,6 @@ Demo shell
from cmd import Cmd
-import numpy as np
-
from txtai.embeddings import Embeddings
class Shell(Cmd):
@@ -35,7 +33,7 @@ class Shell(Cmd):
def default(self, line):
# Get index of best section that best matches query
- uid = np.argmax(self.embeddings.similarity(line, self.sections))
+ uid = self.embeddings.similarity(line, self.sections)[0][0]
print(self.sections[uid])
print()