radareorg / r2ai

local language model for radare2
https://www.radare.org
MIT License
103 stars 17 forks source link

r2ai list non existent models #56

Open cryptax opened 2 months ago

cryptax commented 2 months ago

r2ai -mm is expected (according to doc -h) to list all downloaded models:

[r2ai:0x000061d0]> -mm
     ??? TheBloke/Mistral-7B-Instruct-v0.1-GGUF  
   2.96G cognitivecomputations/dolphin-2.9.4-llama3.1-8b-gguf
     ??? segolilylabs/Lily-Cybersecurity-7B-v0.2-GGUF
     ??? FaradayDotDev/llama-3-8b-Instruct-GGUF  
  11.94G ibm-granite/granite-20b-code-instruct-8k-GGUF

In reality, I only have those models:

$ ls -al ~/.local/share/r2ai/models/
total 15624388
drwxr-xr-x 2 axelle axelle        4096 Sep 17 10:07 .
drwxr-xr-x 3 axelle axelle        4096 Sep 17 10:07 ..
-rw-r--r-- 1 axelle axelle  3179141376 Aug 30 15:27 dolphin-2.9.4-llama3.1-8b-Q2_K.gguf
-rw-r--r-- 1 axelle axelle 12820207360 Sep 17 10:07 granite-20b-code-instruct.Q4_K_M.gguf
-rw-r--r-- 1 axelle axelle          89 Aug 30 11:40 llama.log

I think that TheBloke/Mistral-7B-Instruct-v0.1-GGUF , segolilylabs/Lily-Cybersecurity-7B-v0.2-GGUF and FaradayDotDev/llama-3-8b-Instruct-GGUF were downloaded by me before, but deleted. Looks like I didn't delete them properly for r2ai?

cryptax commented 2 months ago

I tried to delete a model using -m- but it didn't work:

r2ai:0x000061d0]> -m-segolilylabs/Lily-Cybersecurity-7B-v0.2-GGUF
[r2ai:0x000061d0]> -mm
     ??? TheBloke/Mistral-7B-Instruct-v0.1-GGUF  
   2.96G cognitivecomputations/dolphin-2.9.4-llama3.1-8b-gguf
     ??? segolilylabs/Lily-Cybersecurity-7B-v0.2-GGUF
     ??? FaradayDotDev/llama-3-8b-Instruct-GGUF  
  11.94G ibm-granite/granite-20b-code-instruct-8k-GGUF
trufae commented 2 months ago

the meaning of ??? is that the model was registered in the .r2ai.model file from your home, but the file in disk was removed. we can purge them from the json automatically. but maybe we also want to know which files are in the models directory that are not registered by the json.

and yeah you cant remove a model that's not in disk. this can be fixed but maybe we can just silently update the json and hide those ??? . what do you think?

cryptax commented 2 months ago

I think I'd silently update the json to remove the ???, and only leave it to advanced end-users to edit .r2ai.model.