Skip to content

The four Hugging Face operators declare no attributeTypeRules, so the form accepts a column their models cannot read #8316

Description

@kz930

What happened?

Each of the four Hugging Face operators names an input column. Sentiment Analysis, Spam Detection and Text Summarization each read one text column and hand it to a tokenizer, which takes a string and nothing else. Iris Logistic Regression reads two petal measurements, standardizes them and hands them to the model as floats.

None of those pickers says so. Every one carries only @AutofillAttributeName, so the form accepts a column of any type and says nothing until the run fails. Point a text operator at a numeric column and the run ends inside the tokenizer with the message below, which names neither the operator nor the column; point Iris at a string column and the standardization ends it the same way.

The type each of these models can read is fixed, so the form is where it should be said. Operators elsewhere already do this with attributeTypeRules (Url Viz, Waterfall Chart, Sankey Diagram and others), and the frontend turns a rule into a message naming the column, its type, and the type expected. I expected the four Hugging Face operators to carry one too.

How to reproduce?

  1. CSV File Scan on a table holding both a text column and a numeric one.
  2. Connect Hugging Face Text Summarization and set its attribute to the numeric column. The form accepts it without comment.
  3. Run.

The run ends with the error below. The same holds for Sentiment Analysis and Spam Detection, and for Iris Logistic Regression with a string column in either of its two petal fields.

Version/Branch

1.3.0-incubating-SNAPSHOT (main)

Relevant log output

ValueError: text input must be of type `str` (single example), `list[str]` (batch or single pretokenized example) or `list[list[str]]` (batch of pretokenized examples) or `list[tuple[list[str], list[str]]]` (batch of pretokenized sequence pairs).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions