mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
Revert "Use manual looping"
This reverts commit e5fdb0015727edc68938a8a394a83b3c70f9833a.
This commit is contained in:
@@ -458,8 +458,11 @@ def update_token_counter(text: str):
|
||||
max_length = 0
|
||||
|
||||
try:
|
||||
for p in prompt_list:
|
||||
ids.append(getattr(tokenizer(p), 'input_ids', []))
|
||||
try:
|
||||
ids = getattr(tokenizer(prompt_list), 'input_ids', [])
|
||||
except TypeError:
|
||||
for p in prompt_list:
|
||||
ids.append(getattr(tokenizer(p), 'input_ids', []))
|
||||
except Exception as e:
|
||||
shared.log.warning("Token counter:", e)
|
||||
return gr.update(value=f"<span class='gr-box gr-text-input'>??/{max_length}</span>", visible=True)
|
||||
|
||||
Reference in New Issue
Block a user