mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
refactor(lora): drop the unused timer fields and accumulate deactivate time
The restore field had no writer and add() had no caller. Deactivate assigned its elapsed time where activate accumulates, so a generation that unloaded more than once reported only the last pass; both are zeroed together when the generation ends.
This commit is contained in:
@@ -5,7 +5,6 @@ class Timer:
|
||||
calc: float = 0
|
||||
apply: float = 0
|
||||
move: float = 0
|
||||
restore: float = 0
|
||||
activate: float = 0
|
||||
deactivate: float = 0
|
||||
|
||||
@@ -26,13 +25,9 @@ class Timer:
|
||||
self.calc = 0
|
||||
self.apply = 0
|
||||
self.move = 0
|
||||
self.restore = 0
|
||||
if complete:
|
||||
self.activate = 0
|
||||
self.deactivate = 0
|
||||
|
||||
def add(self, name, t):
|
||||
self.__dict__[name] += t
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.__class__.__name__}({self.summary})'
|
||||
|
||||
@@ -330,7 +330,7 @@ def network_deactivate(include=None, exclude=None):
|
||||
module.network_current_names = ()
|
||||
if task is not None:
|
||||
pbar.update(task, advance=1, description=f'networks={len(l.previously_loaded_networks)} modules={active_components} layers={total} unapply={len(applied_layers)}')
|
||||
l.timer.deactivate = time.time() - t0
|
||||
l.timer.deactivate += time.time() - t0
|
||||
if refused > 0:
|
||||
log.error(f'Network unload: type=LoRA networks={[n.name for n in l.previously_loaded_networks]} unapply={len(applied_layers)} refused={refused} network partially removed')
|
||||
if l.debug and len(l.previously_loaded_networks) > 0:
|
||||
|
||||
Reference in New Issue
Block a user