localGPT icon indicating copy to clipboard operation
localGPT copied to clipboard

v2 revised

Open LeafmanZ opened this issue 2 years ago • 2 comments

revised, not sure if its good enough

LeafmanZ avatar Jun 24 '23 01:06 LeafmanZ

@LeafmanZ here are a few changes I suggest to make.

  • The issue with ingest.py when you don't delete the PERSIST_DIRECTORY folder is coming from the fact that you were using SHOW_SOURCES in the setting up the RetreivalQA.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_db inside ingest.py as 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_DB flag inside the localgpt.py for running the ingest.py, now the subprocess code will look like this:

result = subprocess.run(["python", "ingest.py",], capture_output=True)

Let me know what you think.

PromtEngineer avatar Jun 24 '23 17:06 PromtEngineer

Okay made the changes and fixed the readme also. I think this is getting close to good to go for the basis of localgptV2

LeafmanZ avatar Jun 25 '23 01:06 LeafmanZ