Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions promptsource/templates.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import os
import random
import uuid
Expand Down Expand Up @@ -380,6 +381,11 @@ def read_from_file(self) -> Dict:
"""

if not os.path.exists(self.yaml_path):
dataset_name = f"{self.dataset_name} {self.subset_name}" if self.subset_name else self.dataset_name
logging.warning(
f"Tried instantiating `DatasetTemplates` for {dataset_name}, but no prompts found. "
"Please ignore this warning if you are creating new prompts for this dataset."
)
return {}
yaml_dict = yaml.load(open(self.yaml_path, "r"), Loader=yaml.FullLoader)
return yaml_dict[self.TEMPLATES_KEY]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black
black<=21.12b0
datasets>=1.7.0
flake8
isort==5.8.0
Expand Down