Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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)
|