Refactor file paths and load prompts from prompts.yaml

This commit is contained in:
lasseedfast 2024-10-07 17:43:03 +02:00
parent c86d820ff1
commit 4286105ccc
2 changed files with 36 additions and 1 deletions

View File

@ -20,8 +20,14 @@ except LookupError:
logging.info("Downloading 'punkt_tab' tokenizer data for NLTK.")
nltk.download("punkt_tab")
# Get the directory of the current script
script_dir = os.path.dirname(os.path.abspath(__file__))
# Construct the absolute path to the prompts.yaml file
prompts_path = os.path.join(script_dir, 'prompts.yaml')
# Load prompts from configuration file
with open('prompts.yaml', 'r') as file:
with open(prompts_path, 'r') as file:
prompts = yaml.safe_load(file)
CUSTOM_SYSTEM_PROMPT = prompts['CUSTOM_SYSTEM_PROMPT']

29
requirements.txt Normal file
View File

@ -0,0 +1,29 @@
aiofiles==24.1.0
annotated-types==0.7.0
anyio==4.6.0
certifi==2024.8.30
click==8.1.7
distro==1.9.0
exceptiongroup==1.2.2
h11==0.14.0
httpcore==1.0.6
httpx==0.27.2
idna==3.10
jiter==0.6.0
joblib==1.4.2
nltk==3.9.1
numpy==2.1.2
ollama==0.3.3
openai==1.51.1
pydantic==2.9.2
pydantic_core==2.23.4
PyMuPDF==1.24.11
python-dotenv==1.0.1
PyYAML==6.0.2
regex==2024.9.11
scikit-learn==1.5.2
scipy==1.14.1
sniffio==1.3.1
threadpoolctl==3.5.0
tqdm==4.66.5
typing_extensions==4.12.2