diff --git a/prompting/__init__.py b/prompting/__init__.py index 4c4154fca..8b97c2188 100644 --- a/prompting/__init__.py +++ b/prompting/__init__.py @@ -16,7 +16,7 @@ # DEALINGS IN THE SOFTWARE. # Define the version of the template module. -__version__ = "2.6.1" +__version__ = "2.6.2" version_split = __version__.split(".") __spec_version__ = ( (10000 * int(version_split[0])) diff --git a/prompting/tools/datasets/wiki.py b/prompting/tools/datasets/wiki.py index 42a262403..8d1d90991 100644 --- a/prompting/tools/datasets/wiki.py +++ b/prompting/tools/datasets/wiki.py @@ -113,8 +113,10 @@ def process_page( sections = {k: v for k, v in sections.items() if k not in exclude_sections} if selector == "all": - return ("Full Page", "\n\n".join(sections.values())) , sections.keys() - + content = "\n\n".join(sections.values()) + if not valid_section or valid_section(content): + return ("Full Page", content), sections.keys() + return None, sections.keys() valid_sections = [(key, value) for key, value in sections.items() if not valid_section or valid_section(sections[key])] if valid_sections: