mirror of https://github.com/vladmandic/automatic
parent
e572364766
commit
b2b4e13bab
|
|
@ -12,7 +12,7 @@ _lock = Lock()
|
||||||
|
|
||||||
|
|
||||||
def _make_unique(name: str):
|
def _make_unique(name: str):
|
||||||
global _instance_id
|
global _instance_id # pylint: disable=global-statement
|
||||||
with _lock: # Guard against race conditions
|
with _lock: # Guard against race conditions
|
||||||
new_name = f"{name}__{_instance_id}"
|
new_name = f"{name}__{_instance_id}"
|
||||||
_instance_id += 1
|
_instance_id += 1
|
||||||
|
|
|
||||||
|
|
@ -476,7 +476,7 @@ def update_token_counter(text: str):
|
||||||
token_counts = [len(group) - int(has_bos_token) - int(has_eos_token) for group in ids]
|
token_counts = [len(group) - int(has_bos_token) - int(has_eos_token) for group in ids]
|
||||||
if len(token_counts) > 1:
|
if len(token_counts) > 1:
|
||||||
visible = True
|
visible = True
|
||||||
count_formatted = f"{token_counts} {sum(token_counts)}" if shared.opts.prompt_detailed_tokens else str(sum(token_counts))
|
count_formatted = f"{token_counts}/{sum(token_counts)}"
|
||||||
elif len(token_counts) == 1 and token_counts[0] > 0:
|
elif len(token_counts) == 1 and token_counts[0] > 0:
|
||||||
visible = True
|
visible = True
|
||||||
count_formatted = str(token_counts[0])
|
count_formatted = str(token_counts[0])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue