AIlice icon indicating copy to clipboard operation
AIlice copied to clipboard

Small features / corrections

Open benda95280 opened this issue 1 year ago • 1 comments

Dear,

Would it be possible to check :

  • Better handling of error for config.json ? Example : When you try to load something not existing.
  • Creation of the config.json file on first launch of "AIliceWeb.py" with no args (Or with the pip install) ? On first install, i need to execute "--modelID=oai:gpt-4o" to have the message that the file need to be updated (and created).
  • When using the docker file, i have an error about AV missing (Built with Docker for Windows)
  • I can't run it on VM easily, website is not accessible from outside the VM, need to edit py file to add 'share=True' in 'Launch'. Could an args be availaible when launching AIlice ?

Thanks !

benda95280 avatar May 23 '24 23:05 benda95280

I've fixed the issue in the Dockerfile and added the share option.

Regarding your first suggestion, I need more details. Were you encountering a lack of detailed error messages when loading something?

For the second suggestion, regardless of which model you run, AIlice will automatically create the config.json file if it doesn't exist. However, when using models that require an API key(and there is no key found in config.json), AIlice will prompt you for the API key and update it in config.json. This is an on-demand mechanism for updating config.json. If this mechanism does not meet your needs in certain scenarios, please let me know (I currently feel that this approach works quite well).

stevenlu137 avatar May 24 '24 01:05 stevenlu137

On first try, using command below do not create config file :

root@ailice:/home/benda/AIlice/AIlice/ailice# python3 AIliceWeb.py --modelID=lm-studio:Nexesenex/MIstral-QUantized-70b_Miqu-1-70b-iMat.GGUF --contextWindowRatio=0.4
config.json is located at /root/.config/ailice
Encountered an exception, AIlice is exiting: 'lm-studio'
  File "/home/benda/AIlice/AIlice/ailice/AIliceWeb.py", line 224, in main
    mainLoop(**kwargs)
  File "/home/benda/AIlice/AIlice/ailice/AIliceWeb.py", line 32, in mainLoop
    config.Initialize(modelID = modelID)
  File "/home/benda/AIlice/AIlice/ailice/common/AConfig.py", line 176, in Initialize
    needAPIKey = ("apikey" in self.models[modelType] and (self.models[modelType]["apikey"] is None))
                              ~~~~~~~~~~~^^^^^^^^^^^

While command below yes :

root@ailice:/home/benda/AIlice/AIlice/ailice# python3 AIliceWeb.py --modelID=oai:gpt-4o
config.json is located at /root/.config/ailice
config.json need to be updated.
********************** Initialize *****************************
Your oai api-key (press Enter if not):
********************** End of Initialization *****************************

benda95280 avatar May 24 '24 10:05 benda95280

  • There is no information how to generate this file on first launch

benda95280 avatar May 24 '24 10:05 benda95280

The use case lm-studio:Nexesenex/MIstral-QUantized-70b_Miqu-1-70b-iMat.GGUF requires prior configuration of LMStudio and config.json for utilization. Although this is noted in the README, it may not be prominently displayed and could potentially mislead users. You can refer to Example 2 in "How to Add LLM Support" for configuring the model, after which it can be used. All other use case listed can be used directly.

As for creating the configuration file, you only need to run AIlice once normally, and it will generate the config.json file.

stevenlu137 avatar May 24 '24 11:05 stevenlu137

As for creating the configuration file, you only need to run AIlice once normally, and it will generate the config.json file.

Maybe my bad, but i was not able to found the "run normally" way for AIlice ?

benda95280 avatar May 24 '24 14:05 benda95280

You can run any testcase in the list directly except this one. the model:lm-studio:Nexesenex/MIstral-QUantized-70b_Miqu-1-70b-iMat.GGUF does not exist until you complete the configuration of LMStudio and config.json.

stevenlu137 avatar May 24 '24 14:05 stevenlu137

In other words, the model ID is defined in config.json. All other test cases in the testcase list use predefined model IDs, except for this one, which requires the user to configure and define it themselves.

stevenlu137 avatar May 24 '24 14:05 stevenlu137

I have just made some modifications. In the latest commit, it is ensured that config.json exists after the first run of AIlice, and an error message is provided when the specified model ID does not exist.

stevenlu137 avatar May 25 '24 13:05 stevenlu137

Awsome, thanks !

benda95280 avatar May 25 '24 13:05 benda95280