mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-08 12:37:44 +00:00
441ca51af9
* adjust interact and log for CI fix tool * change method to split large code files * refine statistics table after fixing one file * process default --fix option when ruff check * remove hardcode path * add tree-sitter requirements * replace <| |> to < > in comments, for GPT * update mypy version * Add Mypy Evaluator
23 lines
577 B
Python
23 lines
577 B
Python
from pathlib import Path
|
|
from typing import Dict
|
|
|
|
import yaml
|
|
from rdagent.core.utils import SingletonBaseClass
|
|
|
|
|
|
class Prompts(Dict[str, str], SingletonBaseClass):
|
|
def __init__(self, file_path: Path):
|
|
prompt_yaml_dict = yaml.load(
|
|
open(
|
|
file_path,
|
|
encoding="utf8",
|
|
),
|
|
Loader=yaml.FullLoader,
|
|
)
|
|
|
|
if prompt_yaml_dict is None:
|
|
raise ValueError(f"Failed to load prompts from {file_path}")
|
|
|
|
for key, value in prompt_yaml_dict.items():
|
|
self[key] = value
|