jhc13 / taggui

Tag manager and captioner for image datasets
GNU General Public License v3.0
495 stars 26 forks source link

Auto-caption Error message #194

Closed hobolyra closed 3 weeks ago

hobolyra commented 3 weeks ago

The Auto-captioner will load the shards, then throw out this error as soon as it tries to start:

Captioning... (device: cuda:0)
Traceback (most recent call last):
File "auto_captioning\captioning_thread.py", line 450, in run
File "torch\utils\_contextlib.py", line 115, in decorate_context
File "transformers\generation\utils.py", line 1758, in generate
File "transformers\generation\utils.py", line 2410, in _sample
File "transformers\generation\logits_process.py", line 98, in __call__
File "transformers\generation\logits_process.py", line 1125, in __call__
IndexError
:
tuple index out of range

Using Xtuner/llava-llama-3-8b-v1-1-transformers I can run up to 30b 4bit locally through other means, with 24gb vram, so I do know the system/python requirements are there locally. Just something with the transformers in this program that it doesn't like?

WD works, Tried with another llm one (Cogvlm-chat) and got the same error word for word.

jhc13 commented 3 weeks ago

What operating system are you on, and are you using the bundled version or running from source?

Also, what auto-captioner settings are you using?

hobolyra commented 3 weeks ago

What operating system are you on, and are you using the bundled version or running from source?

Also, what auto-captioner settings are you using?

Windows 10, the bundled version, settings: Use GPU, load in 4bit, insert after tags, a few things in the "discourage" prompt, as well as a general prompt, rest default. I have tried changing tokens up and down, as well as a few others, removing any prompts or discouraged words, etc. Still get the same error each time.

jhc13 commented 3 weeks ago

It seems to be caused by an empty string in "Discourage from caption". This can happen if there is a trailing comma, for example.

I will fix it so that empty strings are removed before being sent to the model.

In the meantime, make sure that each comma is followed by some text.

jhc13 commented 3 weeks ago

This has been fixed in v1.28.0.