Model: Fix state flag sets on unload
The load state should be false only if the models are unloaded. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
894be4a818
commit
8b46282aef
1 changed files with 4 additions and 2 deletions
|
|
@ -475,11 +475,13 @@ class ExllamaV2Container:
|
|||
self.tokenizer = None
|
||||
self.generator = None
|
||||
|
||||
# Set all model state variables to False
|
||||
self.model_is_loading = False
|
||||
self.model_loaded = False
|
||||
|
||||
gc.collect()
|
||||
torch.cuda.empty_cache()
|
||||
|
||||
# Update model load state
|
||||
self.model_loaded = False
|
||||
logger.info("Loras unloaded." if loras_only else "Model unloaded.")
|
||||
|
||||
def encode_tokens(self, text: str, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue