Spaces:
Build error
Build error
Update utils/chatbot.py
Browse files- utils/chatbot.py +6 -1
utils/chatbot.py
CHANGED
|
@@ -6,7 +6,12 @@ from utils.document_retrieval import select_document_section_by_query_similarity
|
|
| 6 |
from utils.file_utils import load_file
|
| 7 |
|
| 8 |
# Load the prompt from a file
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
META_PROMPT = load_file(file_path)
|
| 11 |
|
| 12 |
def construct_prompt(query: str, context_embeddings: dict, df: pd.DataFrame) -> tuple[str, str]:
|
|
|
|
| 6 |
from utils.file_utils import load_file
|
| 7 |
|
| 8 |
# Load the prompt from a file
|
| 9 |
+
# Get the absolute path of the current script
|
| 10 |
+
current_script_dir = os.path.dirname(os.path.abspath(__file__))
|
| 11 |
+
|
| 12 |
+
# Construct the absolute path to the "meta_prompt.txt" file
|
| 13 |
+
file_path = os.path.join(current_script_dir, '..', 'data', 'meta_prompt.txt')
|
| 14 |
+
|
| 15 |
META_PROMPT = load_file(file_path)
|
| 16 |
|
| 17 |
def construct_prompt(query: str, context_embeddings: dict, df: pd.DataFrame) -> tuple[str, str]:
|