File size: 374 Bytes
96f6720
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
UTF8_ENCODING = 'utf-8'

def load_prompt(file_name: str) -> str:
    with open(f'prompts/{file_name}', 'r', encoding=UTF8_ENCODING) as f:
        return f.read()

def yield_lines_from_file(file_path: str):
    with open(f'data/{file_path}', 'r', encoding=UTF8_ENCODING) as f:
        for line in f:
            if line: # includes newline
                yield line.strip()