Skip to content

Commit

Permalink
Prevent pipeline warning when using spaCy
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaarsen committed Oct 31, 2023
1 parent 4e414b1 commit de1d681
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions span_marker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
# Set up for Transformers
AutoConfig.register("span-marker", SpanMarkerConfig)
AutoModel.register(SpanMarkerConfig, SpanMarkerModel)
PIPELINE_REGISTRY.register_pipeline(
"span-marker",
pipeline_class=SpanMarkerPipeline,
pt_model=SpanMarkerModel,
type="text",
default={"pt": ("tomaarsen/span-marker-bert-base-fewnerd-fine-super", "main")},
)
if "span-marker" not in PIPELINE_REGISTRY.supported_tasks:
PIPELINE_REGISTRY.register_pipeline(
"span-marker",
pipeline_class=SpanMarkerPipeline,
pt_model=SpanMarkerModel,
type="text",
default={"pt": ("tomaarsen/span-marker-bert-base-fewnerd-fine-super", "main")},
)

# Set up for spaCy
try:
Expand Down

0 comments on commit de1d681

Please sign in to comment.