GLorr's picture
Upload folder using huggingface_hub
6c09f76 verified
raw
history blame contribute delete
375 Bytes
"""This module contains the prompts for the application."""
import json
from jinja2 import Template
def load_prompt(prompt_path: str, **kwargs) -> str:
"""Load the prompt from the given path."""
with open(prompt_path, "r", encoding="utf-8") as file:
prompt = Template(file.read())
return prompt.render(**{k: json.dumps(v) for k, v in kwargs.items()})