ray-project / llm-applications

A comprehensive guide to building RAG-based LLM applications for production.
Creative Commons Attribution 4.0 International
1.71k stars 229 forks source link

Unable to import config #100

Open Rakshasv18 opened 9 months ago

Rakshasv18 commented 9 months ago

To reproduce :

  1. from rag.config import ROOT_DIR

Error :

ModuleNotFoundError Traceback (most recent call last)

in ----> 1 from rag.config import ROOT_DIR ModuleNotFoundError: No module named 'rag.config' 2. Example shown in ipynb # Credentials ray.init(runtime_env={ "env_vars": { "OPENAI_API_BASE": os.environ["OPENAI_API_BASE"], "OPENAI_API_KEY": os.environ["OPENAI_API_KEY"], "ANYSCALE_API_BASE": os.environ["ANYSCALE_API_BASE"], "ANYSCALE_API_KEY": os.environ["ANYSCALE_API_KEY"], "DB_CONNECTION_STRING": os.environ["DB_CONNECTION_STRING"], }, "working_dir": str(ROOT_DIR) }) Gives the output : Python version: 3.10.8 Ray version: 2.7.0 Dashboard: http://session-5ljni527x7edt2q6px7nuaejct.i.anyscaleuserdata-staging.com/ The output i get : Python version: | 3.9.15 -- | -- Ray version: | 2.9.1 I am not able to access that dashboard. 3. Anyscale Platform access : I am trying to access the Anyscale Platform but it does say it needs invitation to progress but fails to send invitation to email , can you please share how to setup in Anyscale Platform. 4. ! export EFS_DIR=$(python -c "from rag.config import EFS_DIR; print(EFS_DIR)") ! wget -e robots=off --recursive --no-clobber --page-requisites \ --html-extension --convert-links --restrict-file-names=windows \ --domains docs.ray.io --no-parent --accept=html --retry-on-http-error=429 \ -P $EFS_DIR https://docs.ray.io/en/master/ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'rag.config' Both --no-clobber and --convert-links were specified, only --convert-links will be used. --2024-02-01 19:48:54-- https://docs.ray.io/en/master/ Resolving docs.ray.io (docs.ray.io)... 104.18.1.163, 104.18.0.163 Connecting to docs.ray.io (docs.ray.io)|104.18.1.163|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] /mnt/shared_storage/ray-assistant-data/docs.ray.io/en/master: No such file or directory /mnt/shared_storage/ray-assistant-data/docs.ray.io/en/master/index.html: No such file or directory Cannot write to ‘/mnt/shared_storage/ray-assistant-data/docs.ray.io/en/master/index.html’ (Success). Converted links in 0 files in 0 seconds.
mriganktiwari commented 9 months ago

Am facing the same issue, appreciate any help.

Rakshasv18 commented 9 months ago

@mriganktiwari I was able to re solve the first error wrt to config path : here are the steps i followed :

import sys import os

rag_module_path = os.path.abspath("path_to/rag_folder/") sys.path.append(rag_module_path)

then import from config import ROOT_DIR

and change rag.config to config in the code.

Initially this resolves but again to load the data i used the below command to run ! export EFS_DIR=$(python -c "from config import EFS_DIR; print(EFS_DIR)") ! wget -e robots=off --recursive --no-clobber --page-requisites \ --html-extension --convert-links --restrict-file-names=windows \ --domains docs.ray.io --no-parent --accept=html --retry-on-http-error=429 \ -P $EFS_DIR https://docs.ray.io/en/master/

but i get an error -

Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'config' Both --no-clobber and --convert-links were specified, only --convert-links will be used. --2024-02-03 09:17:10-- https://docs.ray.io/en/master/ Resolving docs.ray.io (docs.ray.io)... 104.18.1.163, 104.18.0.163 Connecting to docs.ray.io (docs.ray.io)|104.18.1.163|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] /mnt/shared_storage/ray-assistant-data/docs.ray.io/en/master: No such file or directory /mnt/shared_storage/ray-assistant-data/docs.ray.io/en/master/index.html: No such file or directory

Cannot write to ‘/mnt/shared_storage/ray-assistant-data/docs.ray.io/en/master/index.html’ (Success). Converted links in 0 files in 0 seconds.

Shanoa00 commented 7 months ago

Hello~ I was facing the same problem and solved it by copying the folder named "rag" from the repo at the same level of the rag.ipynb notebook. Also, check the file located at rag/config.py to modify the location of the data that will be downloaded.

rossdanlm commented 6 months ago

Hey, running into same issue on Mac M1 because /mnt folder does not exist:

rossdan@Rossdans-MBP llm-applications % ls /mnt/shared_storage/ray-assistant-data
ls: /mnt/shared_storage/ray-assistant-data: No such file or directory
rossdan@Rossdans-MBP llm-applications % ls /mnt
ls: /mnt: No such file or directory