Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ class VietnameseChatbot:
|
|
67 |
]
|
68 |
|
69 |
@st.cache_data
|
70 |
-
def _compute_embeddings(
|
71 |
"""
|
72 |
Pre-compute embeddings for conversation queries
|
73 |
Cached to avoid recomputing on every run
|
@@ -91,8 +91,8 @@ class VietnameseChatbot:
|
|
91 |
return None
|
92 |
|
93 |
embeddings = []
|
94 |
-
for conversation in
|
95 |
-
embedding = embed_single_text(conversation['query'],
|
96 |
if embedding is not None:
|
97 |
embeddings.append(embedding)
|
98 |
return np.array(embeddings)
|
|
|
67 |
]
|
68 |
|
69 |
@st.cache_data
|
70 |
+
def _compute_embeddings(_self): # Add underscore to self parameter
|
71 |
"""
|
72 |
Pre-compute embeddings for conversation queries
|
73 |
Cached to avoid recomputing on every run
|
|
|
91 |
return None
|
92 |
|
93 |
embeddings = []
|
94 |
+
for conversation in _self.conversation_data: # Use _self instead of self
|
95 |
+
embedding = embed_single_text(conversation['query'], _self.tokenizer, _self.model) # Use _self instead of self
|
96 |
if embedding is not None:
|
97 |
embeddings.append(embedding)
|
98 |
return np.array(embeddings)
|