JustKiddo commited on
Commit
3fc35d8
1 Parent(s): aab145f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -67,7 +67,7 @@ class VietnameseChatbot:
67
  ]
68
 
69
  @st.cache_data
70
- def _compute_embeddings(self, _queries=None): # Add _queries parameter with underscore
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 self.conversation_data: # Use self.conversation_data instead of queries
95
- embedding = embed_single_text(conversation['query'], self.tokenizer, self.model) # Use self.tokenizer and self.model
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)