-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XY Grid #1210
XY Grid #1210
Conversation
You may consider adding the "draft" label if you don't mean for this to be merged right away. |
@Loufe I wasn't aware of that. Thank you! |
Cleaned up the interface a little bit. It will now also write the output to an html file and provide a link to open the file for better viewing.
Looks a lot better now and you can choose characters now too. TODO: - better error handling, like for a comma at the beginning of a line - clean up the code. I know a lot of stuff is not optimal yet - make an easier way to add new axis options - add more axis options - LoRA - Seed - Individual parameters - Models (probably way down the road) - checkbox for "constant seed"
Ok, I think I'm finally ready for review. I'll probably add more axis options tomorrow. Specifically, I want to add options for individual parameter presets (shouldn't be hard at all). I'd also like to add LoRAs and models to the mix, but I think I'll wait until they are a little easier to use and the standards are a little more nailed down. I also need to prune down the tracked keys from I think it looks pretty good in the web interface, and I did a fair bit of bug testing, but there's nothing like sending something out to the public to really figure out where the problems are. Would appreciate any help with tightening up my code, as I'm still a novice. It looked a lot jankier before than it does now, though. Here's an updated picture of the UI with a sample generation. I asked them all the same question for testing. I also intentionally made the axis values weird to show how error handling works. If you don't use "characters" for an axis, it will use the currently selected character. If you don't use "prompts" for an axis, it will pull the prompt from the regular input textbox. |
Adding these axis options was causing weird bugs to start appearing that, as far as I can tell, should have appeared before. I added some logic to the main run function to clean them up. It's getting pretty crowded in there though. I might move the run function to its own file. Not sure yet. I also changed some formatting around and got rid of some variables. Still haven't pruned the trackers.
when you load characters, the instruction following characters will also be loaded with the "instruction-following/prefix"
@ClayShoaf |
@kaiokendev Good catch! That fix will work for this particular use case, but it's a little more complicated, because we don't necessarily want to remove all of the history in all cases. This would make the "use chat history" button non-functional, for when people want to include the whole history to influence a prompt. I'll figure out where and what exactly needs to be changed on Monday. I just kind of threw instruct mode in there as an afterthought, because I had a feeling people might want to use that mode. I'll go ahead and throw this back into draft mode until it is working properly. I also need to fix the way that "-1" is handled for the seed options. I didn't think about this until today, but if you put in a seed of "-1" on one of the axes, it's going to generate a new seed for each cell, rather than the whole column/row. I also want to change how the table is output to make the columns uniform in size. |
@kaiokendev I am not able to test it right now, but I took a quick look, and I suspect, in line 347 (as well as it's respective duplicates in other parts of the code), if I might end up breaking the logic out into different files, for instruct vs. chat, but I'm still not sure on that. I also just want to clean it up a bit as well. The mass of code blocks is becoming a little unwieldy. Maybe that's just the nature of the beast. This project is the most complicated thing I've worked on so far (not a programmer by trade). |
extensions/xy_grid/script.py
Outdated
|
||
# Remove the last outputs, so they don't influence future generations | ||
gen_output.pop() | ||
if len(shared.history['internal']) > 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the fix for the context poisoning that was happening with chat mode
- Cleaned up that hideous pile of code blocks. I don't know why I decided to do it like that originally, but I had a day off with just my old laptop and it let me think about my formatting better. It looks a lot cleaner now and should be a lot easier to work on. - Fixed the context poisoning bug when using instruct mode or instruct characters. - Slightly changed the way the table is made, so it should look better when making large grids.
shared.history['visible'].pop() | ||
elif len(shared.history['visible']) == 1: | ||
if shared.history['visible'] == gen_output: | ||
shared.history['visible'].clear() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaiokendev I fixed the context poisoning with this block here. Can you test the new script and see if you find any bugs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how or if I can show more lines of code with my comment, but the instruct portion is at the top of this block, a few lines up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works correctly! one thing I forgot to mention before -- in the output file saving you should change from
mkdir
to
os.makedirs(output_folder)
So it can make the intermediate folders if they don't already exists
Thanks for fixing this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll do that. I was considering putting this in an outputs/xy_grid
folder in the root directory, but I don't know how @oobabooga would feel about that. Personally, I hate when extensions output things to their own folder in SD, but it felt a little presumptuous.
I also would like to include models as an axis option, but it's gonna take a little work to figure out exactly how I want to go about getting the correct instruct characters lined up with the correct models. If you were to load three different models with 3 different instruct characters, it would be pretty much useless for 2/3 of the generations.
Some comments:
|
I'll play around with that. The method I'm using now came from a comment in a discussion thread, because I couldn't figure out how to access those values. I know the way I'm doing it now is pretty hacky.
My initial thought was to either try to parse the model names and auto select the instruct character and include it in the axis textbox with some sort of delimiter, but I think that would look really messy. I also thought about having another dropdown appear for models that would have respective characters for models, but that might be too confusing for an end user, not to mention easy to mess up (although adding pause/stop buttons and live loading the grid should help with that). I'll take a look at the perplexity evaluation and see if I can draw any inspiration (or, you know, just take)
Yea, that's pretty much been my method so far. Just try to format things the way everyone else is doing it. Personally I'm a fan of camel case, but when in Rome... I appreciate the reply. |
This is what the web UI does when you select a model from the dropdown. For instance, if you select a model with "alpaca" in its name, The solution is probably to reuse the https://github.com/oobabooga/text-generation-webui/blob/main/server.py#L254 |
Allowing |
@oobabooga I have tried several different methods of My suspicion is that, because these functions are not being called by |
I'm waiting for huggingface/peft#430 to be resolved before I continue working on this. |
Closing this for inactivity. |
EDIT: It should be ready to go. I would like for at least one other person to test it before I take this out of draft again. I still kind of want to add LoRA to the axis options, but I'm hesistant to add it until the whole monkeypatch thing is fully worked out.
For prompts, they are comma separated, but if you want to include commas in a prompt, you can enclose it in quotes, like so:
There is still some vestigial stuff in here from trying to figure out how to get the information correctly. It will be cleaned up and improved in the coming days.
Here is an example output:
(if you want to track my progress, I'm working on this branch before merging "major" commits.)
Feedback is welcome!