pretzinger commited on
Commit
2da9fe2
·
verified ·
1 Parent(s): 122da82

Fixed error on Syntax

Browse files

past_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)

Files changed (1) hide show
  1. app.py +6 -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
- index.add([past_embedding])
 
 
 
 
 
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):