mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Update comments and add explanations
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user