Skip to content

Commit

Permalink
Merge pull request #361 from Capsize-Games/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
w4ffl35 authored Jan 11, 2024
2 parents d4a8109 + a1c9640 commit d9e4160
Show file tree
Hide file tree
Showing 81 changed files with 2,693 additions and 5,249 deletions.
2 changes: 1 addition & 1 deletion src/airunner/aihandler/auto_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from airunner.aihandler.logger import Logger as logger
from airunner.aihandler.settings_manager import SettingsManager
from airunner.data.managers import SettingsManager


class AutoImport:
Expand Down
8 changes: 4 additions & 4 deletions src/airunner/aihandler/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from airunner.aihandler.llm import LLM
from airunner.aihandler.logger import Logger as logger
from airunner.aihandler.runner import SDRunner
from airunner.aihandler.settings_manager import SettingsManager
from airunner.data.managers import SettingsManager
from airunner.aihandler.tts import TTS


Expand Down Expand Up @@ -104,9 +104,9 @@ def unload_llm(self):
VRAM to keep the LLM loaded while
using other models.
"""
do_unload_model = self.settings_manager.unload_unused_model
do_move_to_cpu = not do_unload_model and self.settings_manager.move_unused_model_to_cpu
dtype = self.settings_manager.llm_generator_setting.dtype
do_unload_model = self.settings_manager.settings.unload_unused_model
do_move_to_cpu = not do_unload_model and self.settings_manager.settings.move_unused_model_to_cpu
dtype = self.settings_manager.llm_generator_settings.dtype
if dtype in ["2bit", "4bit", "8bit"]:
do_unload_model = True
do_move_to_cpu = False
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/aihandler/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from airunner.aihandler.mixins.scheduler_mixin import SchedulerMixin
from airunner.aihandler.mixins.txttovideo_mixin import TexttovideoMixin
from airunner.aihandler.settings import LOG_LEVEL, AIRUNNER_ENVIRONMENT
from airunner.aihandler.settings_manager import SettingsManager
from airunner.data.managers import SettingsManager
from airunner.prompt_builder.prompt_data import PromptData
from airunner.scripts.realesrgan.main import RealESRGAN
from airunner.aihandler.logger import Logger
Expand Down
314 changes: 0 additions & 314 deletions src/airunner/aihandler/settings_manager.py

This file was deleted.

8 changes: 4 additions & 4 deletions src/airunner/aihandler/transformer_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from transformers import InstructBlipForConditionalGeneration
from transformers import InstructBlipProcessor

from airunner.aihandler.settings_manager import SettingsManager
from airunner.data.managers import SettingsManager
from airunner.data.models import LLMGenerator
from airunner.utils import get_session
from airunner.data.session_scope import session_scope
from airunner.aihandler.logger import Logger


Expand Down Expand Up @@ -66,10 +66,10 @@ class TransformerRunner(QObject):
@property
def generator(self):
try:
session = get_session()
if not self._generator or self.current_generator_name != self.requested_generator_name:
self.current_generator_name = self.requested_generator_name
self._generator = session.query(LLMGenerator).filter_by(name=self.current_generator_name).first()
with session_scope() as session:
self._generator = session.query(LLMGenerator).filter_by(name=self.current_generator_name).first()
return self._generator
except Exception as e:
Logger.error(e)
Expand Down
Loading

0 comments on commit d9e4160

Please sign in to comment.