Skip to content

Failure with RAC and more than one text in pipeline #17

@pmbaumgartner

Description

@pmbaumgartner

If you change the example in https://huggingface.co/knowledgator/gliclass-base-v2.0-rac-init so that it contains more than one text, the pipeline returns:

  File "/Users/pbaumgartner/Library/Caches/uv/environments-v2/gliclass-demo-9ee78d962bb2dcd2/lib/python3.12/site-packages/gliclass/utils.py", line 42, in <genexpr>
    label for example in examples for label in example.get("true_labels", [])
                                               ^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'

Replicate by changing this line and putting text in a list:

results = pipeline([text], labels, threshold=0.1, rac_examples=[example_1, example_2])[0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions