HealthAI-Chef / util.py
kikomiko's picture
init
96f6720
raw
history blame contribute delete
374 Bytes
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()