Infinity: Use a runtime type hint for engine
Remove the antipattern of the conditional type for the Async engine and use string-based type inference. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
242ff4f892
commit
aa4ccd03d4
1 changed files with 2 additions and 6 deletions
|
|
@ -17,12 +17,8 @@ class InfinityContainer:
|
|||
model_is_loading: bool = False
|
||||
model_loaded: bool = False
|
||||
|
||||
# Conditionally set the type hint based on importablity
|
||||
# TODO: Clean this up
|
||||
if dependencies.extras:
|
||||
engine: Optional[AsyncEmbeddingEngine] = None
|
||||
else:
|
||||
engine = None
|
||||
# Use a runtime type hint here
|
||||
engine: Optional["AsyncEmbeddingEngine"] = None
|
||||
|
||||
def __init__(self, model_directory: pathlib.Path):
|
||||
self.model_dir = model_directory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue