ivanfioravanti / chatbot-ollama

Chatbot Ollama is an open source chat UI for Ollama.
Other
1.33k stars 217 forks source link

Fixed model selection issue in ModelSelect component #5

Closed ryansereno closed 9 months ago

ryansereno commented 9 months ago

The model selector cannot handle the case where no llama:latest model is available, and only a single ollama model was available, when creating a new conversation. Tries to default to llama:latest, but it does not exist, and dropdown selector does not allow selection of existing model. Added useEffect to use whatever model is available.

Screenshot 2023-10-06 at 11 03 21 PM Screenshot 2023-10-06 at 11 04 51 PM
ryansereno commented 9 months ago

Now that I'm thinking through this more, changing the default model env param would probably resolve this... But I know you'd like to move toward the ability to add/ delete models, so there might still be a need to default to whatever model is available?

ivanfioravanti commented 9 months ago

Super! This makes a lot of sense! Thanks @ryansereno

ryansereno commented 9 months ago

@ivanfioravanti Wanted to let you know that this has broken the application for me; after conversations have been cleared/ default model is not installed, it's no longer allowing me to create any new conversations. Trying to find a solution, but feel free to revert in the meantime.

Simpler fix might just be to alert of the default model is not installed, looking into this now.

ryansereno commented 9 months ago

Sorry for the many updates today. I went ahead and put in that PR for alerting if the default/ fallback model isn't installed.

As long as the user goes ahead and installs the default model or changes their fallback model to something that is installed, this PR is still relevant.

Once I set my fallback model to be the one I have installed, this useEffect to update the selected model works fine.