publish_output

This commit is contained in:
mrT23
2024-04-08 14:00:41 +03:00
parent a543d7ed1a
commit 84d8f78d0c
3 changed files with 5 additions and 2 deletions

View File

@ -575,7 +575,7 @@ def clip_tokens(text: str, max_tokens: int, add_three_dots=True) -> str:
num_output_chars = int(chars_per_token * max_tokens)
clipped_text = text[:num_output_chars]
if add_three_dots:
clipped_text += " ...(truncated)"
clipped_text += "\n...(truncated)"
return clipped_text
except Exception as e:
get_logger().warning(f"Failed to clip tokens: {e}")