Skip to content
Closed
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
2 changes: 1 addition & 1 deletion prompting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# DEALINGS IN THE SOFTWARE.

# Define the version of the template module.
__version__ = "2.5.1"
__version__ = "2.5.2"
version_split = __version__.split(".")
__spec_version__ = (
(10000 * int(version_split[0]))
Expand Down
7 changes: 5 additions & 2 deletions prompting/conversation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import random
from transformers import Pipeline
from prompting.tasks import Task, TASKS, TranslationPipeline, TranslationTask
from prompting.tasks import Task, TASKS, TranslationPipeline, TranslationTask, SummarizationTask
from prompting.tools import Selector, DATASETS
from prompting.task_registry import TASK_REGISTRY

Expand Down Expand Up @@ -42,7 +42,10 @@ def create_task(
if dataset is None:
raise ValueError(f"Dataset {dataset_name} not found")
else:
dataset = dataset()
if task_name == SummarizationTask.name:
dataset = dataset(selector='all')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dataset = dataset(selector='all')
dataset = dataset(selector="all")

Should we just modify the default argument of WikiDataset.get for selector="all", to make the code less coupled?

else:
dataset = dataset()

if task_name == TranslationTask.name:
return task(
Expand Down
15 changes: 10 additions & 5 deletions prompting/tools/datasets/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,18 @@ def get(
)
if not sections:
return None

key = header, section_title = selector(list(sections.keys()))
content = "\n".join(sections[key])
section_length = len(content.split())
if selector == "all":
content = "\n".join(["\n".join(section) for section in sections.values()])
section_length = len(content.split())
topic = "All Sections"
else:
key = header, section_title = selector(list(sections.keys()))
content = "\n".join(sections[key])
section_length = len(content.split())
topic = header or section_title
context = {
"title": name, # title of wiki article
"topic": header or section_title, # title of wiki section
"topic": topic, # title of wiki section
"subtopic": section_title,
"content": content,
"internal_links": list(filter(lambda x: x not in exclude, page.sections)),
Expand Down
4 changes: 2 additions & 2 deletions prompting/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,14 @@ def add_validator_args(cls, parser):
"--wandb.project_name",
type=str,
help="The name of the project where you are sending the new run.",
default="alpha-validators",
default="prompting-validators",
)

parser.add_argument(
"--wandb.entity",
type=str,
help="The name of the project where you are sending the new run.",
default="opentensor-dev",
default="macrocosmos",
)

parser.add_argument(
Expand Down