mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-01-26 11:19:53 +00:00
fix: prepare pydantic v2
This commit is contained in:
@@ -5,16 +5,28 @@ from dataclasses import dataclass
|
||||
from functools import cached_property, partial
|
||||
from typing import Any, Literal, NamedTuple, Optional
|
||||
|
||||
from pydantic import (
|
||||
BaseModel,
|
||||
Extra,
|
||||
NonNegativeFloat,
|
||||
NonNegativeInt,
|
||||
PositiveInt,
|
||||
confloat,
|
||||
conint,
|
||||
validator,
|
||||
)
|
||||
try:
|
||||
from pydantic.v1 import (
|
||||
BaseModel,
|
||||
Extra,
|
||||
NonNegativeFloat,
|
||||
NonNegativeInt,
|
||||
PositiveInt,
|
||||
confloat,
|
||||
conint,
|
||||
validator,
|
||||
)
|
||||
except ImportError:
|
||||
from pydantic import (
|
||||
BaseModel,
|
||||
Extra,
|
||||
NonNegativeFloat,
|
||||
NonNegativeInt,
|
||||
PositiveInt,
|
||||
confloat,
|
||||
conint,
|
||||
validator,
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -8,7 +8,7 @@ license = { text = "AGPL-3.0" }
|
||||
dependencies = [
|
||||
"ultralytics>=8.1",
|
||||
"mediapipe>=10",
|
||||
"pydantic<2",
|
||||
"pydantic<3",
|
||||
"rich>=13",
|
||||
"huggingface_hub",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user