Update comments and add explanations

This commit is contained in:
sabaimran
2023-08-01 09:24:03 -07:00
parent f7e03f6d63
commit 90efc2ea7a
3 changed files with 2 additions and 3 deletions

View File

@@ -124,11 +124,9 @@ def converse_offline(
"""
gpt4all_model = loaded_model or GPT4All(model)
# Initialize Variables
current_date = datetime.now().strftime("%Y-%m-%d")
compiled_references_message = "\n\n".join({f"{item}" for item in references})
# Get Conversation Primer appropriate to Conversation Type
# TODO If compiled_references_message is too long, we need to truncate it.
if compiled_references_message == "":
conversation_primer = user_query
else:

View File

@@ -19,6 +19,7 @@ def download_model(model_name: str):
if os.path.exists(filename):
return GPT4All(model_name)
# Download the model to a tmp file. Once the download is completed, move the tmp file to the actual file
tmp_filename = filename + ".tmp"
try:

View File

@@ -174,7 +174,7 @@ def processor_config(tmp_path_factory):
def processor_config_offline_chat(tmp_path_factory):
processor_dir = tmp_path_factory.mktemp("processor")
# Setup conversation processor, if OpenAI API key is set
# Setup conversation processor
processor_config = ProcessorConfig()
processor_config.conversation = ConversationProcessorConfig(
enable_offline_chat=True,