From f75570b9a6c4be72d5f467e978c6f113534199b6 Mon Sep 17 00:00:00 2001 From: Pablerdo Date: Fri, 21 Mar 2025 13:42:50 -0400 Subject: [PATCH] model path retrieval --- nodes/text_nodes.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nodes/text_nodes.py b/nodes/text_nodes.py index 6e203b1..4f06a47 100644 --- a/nodes/text_nodes.py +++ b/nodes/text_nodes.py @@ -1,4 +1,9 @@ import json +import folder_paths +from pathlib import Path + +llama_model_path = Path(folder_paths.folder_names_and_paths["zepta/llama-2-7b-chat.Q8_0.gguf"]) + class MergePrompts(): @classmethod @@ -31,8 +36,8 @@ class MergePrompts(): # Initialize LLama model (adjust path to your model) try: - model_path = "zepta/llama-2-7b-chat.Q8_0.gguf" # Path to your LLama model - llm = Llama(model_path=model_path, n_ctx=4096) + # model_path = "zepta/llama-2-7b-chat.Q8_0.gguf" # Path to your LLama model + llm = Llama(model_path=llama_model_path, n_ctx=4096) except Exception as e: return f"Error loading LLama model: {str(e)}" @@ -51,7 +56,7 @@ class MergePrompts(): print(generalSa2VAPrompt) print("--------------------------------") - + # Format subjects and their descriptions subject_descriptions = ""