aiverify-foundation / moonshot

Moonshot - A simple and modular tool to evaluate and red-team any LLM application.
https://aiverify-foundation.github.io/moonshot/
Apache License 2.0
141 stars 25 forks source link

[Bug] Web interface doesn't re-install correctly after encountering error #268

Closed shaunkhoo closed 2 weeks ago

shaunkhoo commented 1 month ago

Description

python -m moonshot web doesn't work if node and npm were not installed prior to running python -m moonshot -i moonshot-data -i moonshot-ui. When re-running python -m moonshot -i moonshot-ui to reinstall the web interface, it checks that the moonshot-ui directory is set up and thus skips the setup, but localhost:3000 doesn't return the web interface.

Steps to Reproduce

  1. Ensure your system does not have node and npm installed on your computer.
  2. Install Moonshot using the instructions mentioned here.
  3. Install node and npm after getting the error.
  4. Run python -m moonshot -i moonshot-ui again to see that it reports Directory moonshot-ui already exists, skipping installation..
  5. Run python -m moonshot web to see an empty web page loaded.

Workarounds

You can delete the moonshot-ui folder and re-run python -m moonshot -i moonshot-ui after installing node and npm.

Suggestions

Although both node and npm were included as installation requirements, it would be better to check them upfront before running the installation script to avoid a half-complete installation. Another option is to delete the entire moonshot-ui folder if any error is discovered during the moonshot-ui setup process.

hingsoon commented 1 month ago

Does this tool install for Windows environment?

python 3.11.9 node v20.16.0 npm 10.8.1

everytime I run, I am getting the error below.

---error snippet

Generating static pages (0/25) [ ]TypeError: fetch failed at node:internal/deps/undici/undici:13178:13 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ...

Export encountered errors on following paths: /benchmarking/cookbooks/page: /benchmarking/cookbooks Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code

imda-lionelteo commented 1 month ago

@imda-benedictlee can you take a look at this

imda-normanchia commented 1 month ago

hi @hingsoon it should work with windows environment. is it possible for you to share your logs so that we can better debug this issue?

hingsoon commented 1 month ago

Not sure how to get the logs but I will attach all the pip install instructions and whatever I see on screen here.

moonshot_installation_log.txt moonshot_install.txt pip_install.txt

imda-amdlahir commented 1 month ago

Does this tool install for Windows environment?

python 3.11.9 node v20.16.0 npm 10.8.1

everytime I run, I am getting the error below.

---error snippet

Generating static pages (0/25) [ ]TypeError: fetch failed at node:internal/deps/undici/undici:13178:13 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ...

Export encountered errors on following paths: /benchmarking/cookbooks/page: /benchmarking/cookbooks Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code

Hi @hingsoon This PR should resolve the issue. Will let you know when it's merged. PR - https://github.com/aiverify-foundation/moonshot-ui/pulls