From b18de2e9b563651472ce21a1dee160e47ca3857d Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Wed, 22 Apr 2026 15:19:46 -0700 Subject: [PATCH 1/2] Fix display typo --- modules/ui_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui_common.py b/modules/ui_common.py index 4f758909c..3c9a33b49 100644 --- a/modules/ui_common.py +++ b/modules/ui_common.py @@ -509,7 +509,7 @@ def update_token_counter(text: str): token_counts = [len(group) - int(has_bos_token) - int(has_eos_token) for group in ids] if len(token_counts) > 1: visible = True - count_formatted = f"{token_counts}/{sum(token_counts)}" + count_formatted = f"{token_counts} {sum(token_counts)}" elif len(token_counts) == 1 and token_counts[0] > 0: visible = True count_formatted = str(token_counts[0]) From 1d5154e12545567887e1c64c27a1ad6a531a3908 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Wed, 22 Apr 2026 14:35:56 -0700 Subject: [PATCH 2/2] Don't display empty groups --- modules/ui_common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ui_common.py b/modules/ui_common.py index 3c9a33b49..cd09e33b1 100644 --- a/modules/ui_common.py +++ b/modules/ui_common.py @@ -507,6 +507,7 @@ def update_token_counter(text: str): return gr.update(value=f"??/{max_length}", visible=True) token_counts = [len(group) - int(has_bos_token) - int(has_eos_token) for group in ids] + token_counts = [tc for tc in token_counts if tc > 0] if len(token_counts) > 1: visible = True count_formatted = f"{token_counts} {sum(token_counts)}"