Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/guidellm/backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def create(cls, type_: BackendType, **kwargs) -> "Backend":

def __init__(self, type_: BackendType):
self._type = type_
self._validated = False

@property
def type_(self) -> BackendType:
Expand Down Expand Up @@ -124,6 +125,8 @@ async def validate(self):
Handle final setup and validate the backend is ready for use.
If not successful, raises the appropriate exception.
"""
if self._validated:
return
logger.info("{} validating backend {}", self.__class__.__name__, self.type_)
await self.check_setup()
models = await self.available_models()
Expand All @@ -146,6 +149,7 @@ async def validate(self):
pass

await self.reset()
self._validated = True

@abstractmethod
async def check_setup(self):
Expand Down