AceBeaker2 / StableHorde-LemonBot

A feature-packed multi-model text2image discord bot!
Apache License 2.0
5 stars 2 forks source link

Some Models randomly become unavailable #2

Open NumbersOfFuz opened 1 month ago

NumbersOfFuz commented 1 month ago

The bot has an issue where some models sometimes disappear from the models option in the command interface. I know it's an issue with the bot because when I click on a the Make Variations button that was using a model that isn't in the models option anymore, the generation still works. (Most of the time) Even if I wait 30 minutes it still works. Screenshot_20240806_183500 Screenshot_20240806_184411 I'll see if I can figure out the issue, if I do I'll be sure to open a PR.

NumbersOfFuz commented 1 month ago

I believe I have found the problem:

def get_top_models(data, num_models=25):
    # Sort the data by count value
    sorted_data = sorted(data, key=lambda x: x['count'], reverse=True)

    # Return the top num_models models
    return sorted_data[:num_models]

https://github.com/AceBeaker2/StableHorde-LemonBot/blob/main/config.py#L201 It only shows the top 25 models. (by default)

Edit: Turns out the limit for that type of input is 25 by discord, makes sense. I'll make a PR that adds a force function to makes it to validate the input model off of the API list and not the 25 internal list.