Skip to content

Commit

Permalink
Merge pull request #4 from rishiraj/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
rishiraj authored Apr 14, 2024
2 parents 860dc61 + ed3c547 commit 8ef9dec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spanking/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def delete_text(self, index):
def update_text(self, index, new_text):
if 0 <= index < len(self.texts):
self.texts[index] = new_text
new_embedding = self.model.encode([new_text], normalize_embeddings=True)
self.embeddings = jax.ops.index_update(self.embeddings, index, new_embedding)
new_embedding = self.model.encode([new_text], normalize_embeddings=True).squeeze()
self.embeddings = (self.embeddings).at[index].set(new_embedding)
else:
raise IndexError("Invalid index")

Expand Down

0 comments on commit 8ef9dec

Please sign in to comment.