mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-15 00:07:28 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user