mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-14 00:53:25 +00:00
fix: singleton
This commit is contained in:
@ -9,8 +9,9 @@ from .tesou import Tesou
|
||||
from .fastchat import Fastchat
|
||||
from .g2e import G2E
|
||||
from .text_and_image import TextAndImage
|
||||
from injector import inject
|
||||
from injector import inject, singleton
|
||||
|
||||
@singleton
|
||||
class BlackboxFactory:
|
||||
models = {}
|
||||
|
||||
@ -40,7 +41,7 @@ class BlackboxFactory:
|
||||
def __call__(self, *args, **kwargs):
|
||||
return self.processing(*args, **kwargs)
|
||||
|
||||
def create_blackbox(self, blackbox_name: str) -> Blackbox:
|
||||
def call_blackbox(self, blackbox_name: str) -> Blackbox:
|
||||
model = self.models.get(blackbox_name)
|
||||
if model is None:
|
||||
raise ValueError("Invalid blockbox type")
|
||||
|
||||
Reference in New Issue
Block a user