Fix import error caused by pydantic on cpu (#11474)

This commit is contained in:
binbin Deng 2024-07-01 15:49:49 +08:00 committed by GitHub
parent dbba51f455
commit 48ad482d3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,7 +32,11 @@ logger = logging.getLogger(__name__)
import asyncio
import uuid
import threading
from pydantic import BaseModel
try:
from pydantic import BaseModel
except ImportError:
from abc import ABCMeta
BaseModel = ABCMeta
# patch GenerationMixin.generate
from transformers import GenerationMixin