diff --git a/rag/utils/__init__.py b/rag/utils/__init__.py index 63bb582a7..8f0d8c28f 100644 --- a/rag/utils/__init__.py +++ b/rag/utils/__init__.py @@ -85,6 +85,6 @@ def num_tokens_from_string(string: str) -> int: return 0 -def truncate(string: str, max_len: int) -> int: +def truncate(string: str, max_len: int) -> str: """Returns truncated text if the length of text exceed max_len.""" return encoder.decode(encoder.encode(string)[:max_len])