llm-applications icon indicating copy to clipboard operation
llm-applications copied to clipboard

Unable to import config

Open Rakshasv18 opened this issue 1 year ago • 4 comments

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'

  1. 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.

  1. 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.

  2. ! 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.

Rakshasv18 avatar Feb 02 '24 00:02 Rakshasv18

Am facing the same issue, appreciate any help.

mriganktiwari avatar Feb 03 '24 09:02 mriganktiwari

@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.

Rakshasv18 avatar Feb 03 '24 14:02 Rakshasv18

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.

Shanoa00 avatar Apr 15 '24 03:04 Shanoa00

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

rossdanlm avatar Apr 25 '24 00:04 rossdanlm