fixed the life cycle of the models (they couldn't unload anymore) and simplified the implementation of the Python models
This commit is contained in:
parent
f647c960dd
commit
8bf28e4c48
9 changed files with 96 additions and 111 deletions
|
@ -7,7 +7,7 @@ import source
|
|||
|
||||
|
||||
class BaseInterface(abc.ABC):
|
||||
def __init__(self, model: "source.model.base.BaseModel"):
|
||||
def __init__(self, model: "source._model.base.BaseModel"):
|
||||
self.model = model
|
||||
|
||||
@property
|
||||
|
@ -20,7 +20,7 @@ class BaseInterface(abc.ABC):
|
|||
return f"{self.model.api_base}/interface"
|
||||
|
||||
@abc.abstractmethod
|
||||
def get_gradio_application(self) -> gradio.Blocks:
|
||||
def get_application(self) -> gradio.Blocks:
|
||||
"""
|
||||
Get a gradio application
|
||||
:return: a gradio application
|
||||
|
@ -35,6 +35,6 @@ class BaseInterface(abc.ABC):
|
|||
|
||||
gradio.mount_gradio_app(
|
||||
application,
|
||||
self.get_gradio_application(),
|
||||
self.get_application(),
|
||||
self.route
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue