Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_card fails when preprocess_steps is None #778

Closed
marukaz opened this issue Apr 18, 2024 · 0 comments · Fixed by #780
Closed

test_card fails when preprocess_steps is None #778

marukaz opened this issue Apr 18, 2024 · 0 comments · Fixed by #780

Comments

@marukaz
Copy link
Contributor

marukaz commented Apr 18, 2024

After I updated unitxt from 1.7.6 to 1.7.7, if there is no preprocess_steps, test_card() fails with

  File "/Users/marukaz/ghq/github.com/marukaz/unitxt/src/unitxt/standard.py", line 293, in prepare
    super().prepare()
  File "/Users/marukaz/ghq/github.com/marukaz/unitxt/src/unitxt/standard.py", line 215, in prepare
    self.standardization.steps.extend(self.card.preprocess_steps)
TypeError: 'NoneType' object is not iterable

Example card:

from unitxt.blocks import (
    AddFields,
    LoadHF,
    TaskCard,
)
from unitxt.catalog import add_to_catalog
from unitxt.test_utils.card import test_card

card = TaskCard(
    loader=LoadHF(path="EdinburghNLP/xsum"),
    # preprocess_steps=[
    #     AddFields(fields={"document_type": "document"}),
    # ],
    task="tasks.summarization.abstractive",
    templates="templates.summarization.abstractive.all",
)

test_card(card)
add_to_catalog(card, "cards.xsum", overwrite=True)

The cause is None check has been removed in this PR https://github.com/IBM/unitxt/pull/739/files#diff-a4122a708bc5f51b81dc0316fb8034bff822104b0e9d82bbe30d44761979ec36L144

I think either the code for the None check should be reinstated, or the default for preprocess_steps should be changed from None to an empty list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant