Cheselle commited on
Commit
bc4b9a8
·
verified ·
1 Parent(s): 6cca36c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -26,6 +26,9 @@ class SentenceTransformerEmbedding:
26
  def embed_documents(self, texts):
27
  return self.model.encode(texts, convert_to_tensor=True).tolist() # Convert to list for compatibility
28
 
 
 
 
29
  @cl.on_chat_start
30
  async def on_chat_start():
31
  model = ChatOpenAI(streaming=True)
 
26
  def embed_documents(self, texts):
27
  return self.model.encode(texts, convert_to_tensor=True).tolist() # Convert to list for compatibility
28
 
29
+ def __call__(self, texts):
30
+ return self.embed_documents(texts) # Make it callable
31
+
32
  @cl.on_chat_start
33
  async def on_chat_start():
34
  model = ChatOpenAI(streaming=True)