Spaces:
Build error
Build error
Fixed error on Syntax
Browse filespast_embedding = embed_text(past_conversation)
past_embedding = np.array(past_embedding) # Convert to numpy array
# Reshape if necessary (e.g., (1, 768) for PubMedBERT)
past_embedding = past_embedding.reshape(1, -1)
app.py
CHANGED
|
@@ -30,7 +30,12 @@ def embed_text(text):
|
|
| 30 |
# Add past conversation embedding to FAISS index
|
| 31 |
past_conversation = "FDA approval for companion diagnostics requires careful documentation."
|
| 32 |
past_embedding = embed_text(past_conversation)
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# Search past conversations/memory using FAISS
|
| 36 |
def search_memory(query):
|
|
|
|
| 30 |
# Add past conversation embedding to FAISS index
|
| 31 |
past_conversation = "FDA approval for companion diagnostics requires careful documentation."
|
| 32 |
past_embedding = embed_text(past_conversation)
|
| 33 |
+
past_embedding = np.array(past_embedding) # Convert to numpy array
|
| 34 |
+
|
| 35 |
+
# Reshape if necessary (e.g., (1, 768) for PubMedBERT)
|
| 36 |
+
past_embedding = past_embedding.reshape(1, -1)
|
| 37 |
+
|
| 38 |
+
index.add(past_embedding)
|
| 39 |
|
| 40 |
# Search past conversations/memory using FAISS
|
| 41 |
def search_memory(query):
|