mirror of https://github.com/explosion/spaCy.git
use pydantic version instead
This commit is contained in:
parent
52342fc741
commit
7abfb4e3e8
|
@ -1,11 +1,12 @@
|
||||||
import re
|
import re
|
||||||
from typing import Callable, List, Optional, Union
|
from typing import Callable, List, Optional, Union
|
||||||
|
|
||||||
|
import pydantic
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
try:
|
if pydantic.VERSION.split(".")[0] == "1": # type: ignore
|
||||||
from pydantic import validator # type: ignore
|
from pydantic import validator # type: ignore
|
||||||
except ImportError:
|
else:
|
||||||
from pydantic import field_validator as validator # type: ignore
|
from pydantic import field_validator as validator # type: ignore
|
||||||
|
|
||||||
from ..language import Language
|
from ..language import Language
|
||||||
|
|
Loading…
Reference in New Issue