private-gpt icon indicating copy to clipboard operation
private-gpt copied to clipboard

Can I change the source_documents location

Open ChapmanKU opened this issue 2 years ago • 4 comments
trafficstars

Is it possible to change the source documents location, to, for example a NAS folder containing all my PDFs?

ChapmanKU avatar Jun 07 '23 09:06 ChapmanKU

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

diamondbarcode avatar Jun 07 '23 18:06 diamondbarcode

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

DjToMeK30 avatar Jun 08 '23 12:06 DjToMeK30

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.

melroy89 avatar Jun 09 '23 00:06 melroy89

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

DjToMeK30 avatar Jun 09 '23 05:06 DjToMeK30