From 7abfb4e3e86def11125eb50e36a4598c36a2aec4 Mon Sep 17 00:00:00 2001 From: India Kerle Date: Thu, 7 Mar 2024 10:56:27 -0300 Subject: [PATCH] use pydantic version instead --- spacy/pipeline/coordinationruler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/pipeline/coordinationruler.py b/spacy/pipeline/coordinationruler.py index a056f5f93..31ae729c5 100644 --- a/spacy/pipeline/coordinationruler.py +++ b/spacy/pipeline/coordinationruler.py @@ -1,11 +1,12 @@ import re from typing import Callable, List, Optional, Union +import pydantic from pydantic import BaseModel -try: +if pydantic.VERSION.split(".")[0] == "1": # type: ignore from pydantic import validator # type: ignore -except ImportError: +else: from pydantic import field_validator as validator # type: ignore from ..language import Language