private-gpt
private-gpt copied to clipboard
Can I change the source_documents location
Is it possible to change the source documents location, to, for example a NAS folder containing all my PDFs?
i was wondering too there trick to link folder not sure if that work i do not test .. but i know if your documents using unicode it give error .. so far it does not understand other language well English seem only thing it know
@ChapmanKU in ingest.py you have
source_directory = os.environ.get('SOURCE_DIRECTORY', 'source_documents')
Here it looks for system environment variable SOURCE_DIRECTORY if it is set
if not
it looks into source_documents
You can specify system variable or just change something like this
os.environ.get('SOURCE_DIRECTORY', r'\\192.168.0.100\path\to\nas\folder')
Does this work?
Lol.. That might be not ideal.. The whole point of a environment variable, is to actually use this variable in the terminal.
You can set this variable using Bash using:
export SOURCE_DIRECTORY=/some/folder/path
After which you can try to execute the python script, without the need to change the code.....
Depending on your operating system and your NAS solution, you might need to mount this remote locally first. So you can provide the SOURCE_DIRECTORY variable a path to an actual folder on your local system.
Yes, that is why I said he can change system env first... But sometimes you don't want to do that or don't need it if you want to quickly check if it works and then set env variable when you are actually sure