Closed firsc closed 4 months ago
oh thanks for catching that, I meant to remove the check for that one when I removed the rest.
fixed the bug, report back if it worked and then I'll close the issue
Hi, I've tried it again. The first bug has been fixed, but the other two are still there, namely that the traceback response is decoded with response.json()
in main_ui_files/MainUI.py:163
(maybe this could be a response.content().decode()
instead?) and that within the backend module in backend/utils/validation.py:77
there's len(args[arg])
which is probably supposed to be len(val)
to check the length of the keep_tokens_separator string.
it shouldn't be checking the length anymore at all.
so long as validation doesn't crash, it will always output a predicable json format to display what has failed validation, no need to change that, if it crashes, it should crash, so I don't plan on changing that.
I made the change to the validation, you were right, I wasn't checking the correct element, so I made that change
Thanks, appreciate your work! I think this issue can be closed then
On the dev branch, the token separator function does not work anymore. I believe it worked on one of the previous commits. Either interacting with this text box (inserting or removing text) or loading in toml files with a given token separator will spit the same error:
The effects of this are:
keep_tokens_separator
is interrupted and the data subsets are not loaded from the toml (in my case I've set the separator to'|||'
)keep_tokens_separator
is forwarded to kohya's scriptIf I do a dirty quick fix by replacing
not elem.allow_empty
with(hasattr(elem, 'allow_empty') and not elem.allow_empty)
, loading tomls and interacting with the separator text box works again, but submitting will then lead to a new error:Seems like the response throws a 500. The response itself is from the POST in line 158 of MainUI.py in
f"{url}/validate", json=True, data=json.dumps(final_args)
, so something in the validate endpoint fails. The response itself is not JSON but an encoded string of a traceback, soresponse.json()
will fail. Replacing this withresponse.content.decode()
reveals the following traceback:Inside this backend code, replacing
len(args[arg])
withlen(val)
orlen(value[arg])
fixes this problem.To summarize, there were 3 bugs that I found:
LineEditWithHighlightMin
which is used by Keep Tokens Separator is missing the'allow_empty'
attribute.json()
calllen(args[arg])
trips up in the validatorMy intention with the token separator is to train LoRAs which are compatible with NAIv3/Animagine's tag ordering. I'm on WSL, latest dev commit (4bda9fb).