Refactor:remove use less convert for FastEmbed (#8984)

### What problem does this PR solve?

remove use less convert for FastEmbed

### Type of change

- [x] Refactoring
This commit is contained in:
Stephen Hu
2025-07-23 10:51:48 +08:00
committed by GitHub
parent 0d7244e4a4
commit ec21d9a98f

View File

@ -352,8 +352,7 @@ class FastEmbed(DefaultEmbedding):
# Using the internal tokenizer to encode the texts and get the total # Using the internal tokenizer to encode the texts and get the total
# number of tokens # number of tokens
encoding = self._model.model.tokenizer.encode(text) encoding = self._model.model.tokenizer.encode(text)
embedding = next(self._model.query_embed(text)).tolist() embedding = next(self._model.query_embed(text))
return np.array(embedding), len(encoding.ids) return np.array(embedding), len(encoding.ids)