localGPT
localGPT copied to clipboard
v2 revised
revised, not sure if its good enough
@LeafmanZ here are a few changes I suggest to make.
- The issue with ingest.py when you don't delete the
PERSIST_DIRECTORYfolder is coming from the fact that you were usingSHOW_SOURCESin the setting up theRetreivalQA.from_chain_type. I will change it to:
self.QA = RetrievalQA.from_chain_type( llm=self.LLM, chain_type="stuff", retriever=retriever, return_source_documents=True,)
Note return_source_documents=True instead of using SHOW_SOURCES in localGPT.py
- I would modify the
create_dbinsideingest.pyas this:
if os.path.exists(PERSIST_DIRECTORY): if RESET_DB: logging.info(f"DB Already Exists - Removing it") shutil.rmtree(PERSIST_DIRECTORY) else: logging.info(f"DB Already Exists - Using the existing DB")
to check if the PERSIST_DIRECTORY already exists or not. This seems to work. We will need to add RESET_DB in config.py
- I removed the
reset_DBflag inside the localgpt.py for running theingest.py, now the subprocess code will look like this:
result = subprocess.run(["python", "ingest.py",], capture_output=True)
Let me know what you think.
Okay made the changes and fixed the readme also. I think this is getting close to good to go for the basis of localgptV2