radareorg / r2ai

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

No module named 'huggingface_hub #34

Closed cryptax closed 2 months ago

cryptax commented 2 months ago

The doc says that we can run r2ai as a plugin: r2 -i main.py binary. So, I tried that: r2 -i /home/axelle/.local/share/radare2/r2pm/git/r2ai/main.py ./libapp.so

ERROR: Cannot determine entrypoint, using 0x00170000
WARN: Relocs has not been applied. Please use `-e bin.relocs.apply=true` or `-e bin.cache=true` next time
Traceback (most recent call last):
  File "/home/axelle/.local/share/radare2/r2pm/git/r2ai/main.py", line 24, in <module>
    main()
  File "/home/axelle/.local/share/radare2/r2pm/git/r2ai/main.py", line 19, in main
    import r2ai.main
  File "/home/axelle/.local/share/radare2/r2pm/git/r2ai/r2ai/main.py", line 8, in <module>
    from r2ai.repl import r2ai_singleton
  File "/home/axelle/.local/share/radare2/r2pm/git/r2ai/r2ai/repl.py", line 2, in <module>
    from .models import set_default_model, models, mainmodels
  File "/home/axelle/.local/share/radare2/r2pm/git/r2ai/r2ai/models.py", line 2, in <module>
    from huggingface_hub import hf_hub_download, login
ModuleNotFoundError: No module named 'huggingface_hub'
 -- Noot noot
[0x00170000]> q

In case I need to be in main.py directory, I tried the other way round, with r2 -i ./main.py ~/git/research/flutter/w0rdle-unzipped/lib/arm64-v8a/libapp.so but it's the same error.

cryptax commented 2 months ago

Fixed the issue myself: you need to create a virtual environment and do pip install -r requirements.txt for r2ai.

trufae commented 2 months ago

that's what the makefile does