From 88011b0e42d309afa0598f1e7b8872ca7eef3384 Mon Sep 17 00:00:00 2001 From: Adrian Charkiewicz Date: Sat, 17 Jun 2023 12:42:32 +0200 Subject: [PATCH] path to file with characters moved to .env --- ai_talks/AMUseBotBackend/src/DP/dp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ai_talks/AMUseBotBackend/src/DP/dp.py b/ai_talks/AMUseBotBackend/src/DP/dp.py index 5cd191a..5505335 100644 --- a/ai_talks/AMUseBotBackend/src/DP/dp.py +++ b/ai_talks/AMUseBotBackend/src/DP/dp.py @@ -7,6 +7,9 @@ import AMUseBotBackend.consts as c import json import streamlit as st +from dotenv import load_dotenv +load_dotenv() +CHARACTERS = os.getenv('CHARACTERS') class DP: @@ -14,12 +17,12 @@ class DP: def __init__(self, dst: DST, llm_rephrasing=False, character='default'): #TODO: a way to set llm_rephrasing status and a character self.dst_module = dst self.llm_rephrasing = llm_rephrasing - with open('ai_talks/AMUseBotBackend/utils/characters_dict.json') as f: + with open(CHARACTERS) as f: characters_dict = json.load(f) self.character = characters_dict[character] def change_character(self, character): - with open('ai_talks/AMUseBotBackend/utils/characters_dict.json') as f: + with open(CHARACTERS) as f: characters_dict = json.load(f) self.character = characters_dict[character] if self.character == 'default':