image_models.py 374 B

123456789101112131415
  1. from __future__ import annotations
  2. from ..models import ModelUtils
  3. class ImageModels():
  4. def __init__(self, client):
  5. self.client = client
  6. self.models = ModelUtils.convert
  7. def get(self, name, default=None):
  8. model = self.models.get(name)
  9. if model and model.best_provider:
  10. return model.best_provider
  11. return default