Skip to content

TypeError when using tomaarsen/span-marker-mbert-base-multinerd #77

@xyber-nova

Description

@xyber-nova

This model doesn't have encoder attribute, and None cannot be subscriptable.

Things all right after apply this patch:

def patch():
    from span_marker.configuration import SpanMarkerConfig
    
    def patch_getattribute(self, key: str):
        try:
            return super(SpanMarkerConfig, self).__getattribute__(key)
        except AttributeError as e:
            try:
                return super(SpanMarkerConfig, self).__getattribute__("encoder")[key]
            except KeyError:
                raise e
            except TypeError:
                raise e
    
    SpanMarkerConfig.__getattribute__ = patch_getattribute

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions