mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
TEI auto truncate inputs (#10916)
### What problem does this PR solve? TEI auto truncate inputs ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -82,7 +82,7 @@ class BuiltinEmbed(Base):
|
||||
|
||||
def encode(self, texts: list):
|
||||
batch_size = 16
|
||||
texts = [truncate(t, self._max_tokens) for t in texts]
|
||||
# TEI is able to auto truncate inputs according to https://github.com/huggingface/text-embeddings-inference.
|
||||
token_count = 0
|
||||
ress = None
|
||||
for i in range(0, len(texts), batch_size):
|
||||
|
||||
Reference in New Issue
Block a user