dejanseo commited on
Commit
b5b276c
·
verified ·
1 Parent(s): a19307d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -230,13 +230,13 @@ def load_embedding_model(model_name="mixedbread-ai/mxbai-embed-large-v1"):
230
  return tokenizer, model
231
 
232
  @st.cache_data
233
- def generate_embeddings(_tokenizer, model, text_list):
234
  """Generates embeddings for a list of text entries."""
235
  encoded_input = _tokenizer(
236
  text_list, padding=True, truncation=True, return_tensors="pt"
237
  )
238
  with torch.no_grad():
239
- model_output = model(**encoded_input)
240
  embeddings = model_output.last_hidden_state.mean(dim=1)
241
  return embeddings.cpu().numpy()
242
 
 
230
  return tokenizer, model
231
 
232
  @st.cache_data
233
+ def generate_embeddings(_tokenizer, _model, text_list):
234
  """Generates embeddings for a list of text entries."""
235
  encoded_input = _tokenizer(
236
  text_list, padding=True, truncation=True, return_tensors="pt"
237
  )
238
  with torch.no_grad():
239
+ model_output = _model(**encoded_input)
240
  embeddings = model_output.last_hidden_state.mean(dim=1)
241
  return embeddings.cpu().numpy()
242