this seems to be looping loading the model and eventually runs out of memory. Suggesitons? import os
import sys
import time
import itertools
import threading
import glob
import openai
import streamlit_embedcode
import streamlit as st

import re
from io import BytesIO
from typing import Any, Dict, List

import docx2txt
import streamlit as st
from langchain.chains.qa_with_sources import load_qa_with_sources_chain
from langchain.docstore.document import Document
from langchain.llms import OpenAI
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.vectorstores import VectorStore
from langchain.vectorstores.faiss import FAISS
from openai.error import AuthenticationError
from pypdf import PdfReader

from knowledge_gpt.embeddings import OpenAIEmbeddings
from knowledge_gpt.prompts import STUFF_PROMPT

from langchain.chains import RetrievalQA
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.vectorstores import Chroma
from langchain.llms import GPT4All, LlamaCpp
import os
import dotenv
from dotenv import load_dotenv
import argparse
from argparse import ArgumentParser
from contextlib import contextmanager, redirect_stdout
from io import StringIO
from time import sleep
import streamlit as st
import constants
import typing
from typing import List
from dotenv import load_dotenv
import gpt4all

load_dotenv()

from flair import *
from streamlit_embedcode import *

parser = ArgumentParser()
parser.add_argument('--persist-dir', type=str, default='./_db', help='Directory to persist model checkpoints and trained models')
parser.add_argument('--model-type', type=str, default='gpt4', help='Type of model to use (gpt4, llama, or huggingface)')
parser.add_argument('--model-path', type=str, default=None, help='Path to pre-trained model checkpoint')
parser.add_argument('--model-n-ctx', type=int, default=None, help='Number of contexts to use for GPT-4 model')

from prompts import get_personal_prompt

from langchain.document_loaders import (
CSVLoader,
EverNoteLoader,
PDFMinerLoader,
TextLoader,
UnstructuredEmailLoader,
UnstructuredEPubLoader,
UnstructuredHTMLLoader,
UnstructuredMarkdownLoader,
UnstructuredODTLoader,
UnstructuredPowerPointLoader,
UnstructuredWordDocumentLoader,
)
import os
from dotenv import load_dotenv

load_dotenv() # take environment variables from .env.

persist_directory = os.getenv("PERSIST_DIRECTORY")
embeddings_model_name = os.getenv("EMBEDDINGS_MODEL_NAME")
model_type = os.getenv("MODEL_TYPE")
model_path = os.getenv("MODEL_PATH")
model_n_ctx = Use words with all capital letters to highlight key points, but make sure that words with all capital letters appear less than 3 times
user