Fix issue 296
This commit is contained in:
parent
819a5718ea
commit
e93de7f8ea
@ -25,7 +25,7 @@ from library.common_gui import (
|
|||||||
gradio_config,
|
gradio_config,
|
||||||
gradio_source_model,
|
gradio_source_model,
|
||||||
set_legacy_8bitadam,
|
set_legacy_8bitadam,
|
||||||
update_optimizer,
|
my_data,
|
||||||
)
|
)
|
||||||
from library.tensorboard_gui import (
|
from library.tensorboard_gui import (
|
||||||
gradio_tensorboard,
|
gradio_tensorboard,
|
||||||
@ -214,7 +214,7 @@ def open_configuration(
|
|||||||
my_data = json.load(f)
|
my_data = json.load(f)
|
||||||
print('Loading config...')
|
print('Loading config...')
|
||||||
# Update values to fix deprecated use_8bit_adam checkbox and set appropriate optimizer if it is set to True
|
# Update values to fix deprecated use_8bit_adam checkbox and set appropriate optimizer if it is set to True
|
||||||
my_data = update_optimizer(my_data)
|
my_data = my_data(my_data)
|
||||||
else:
|
else:
|
||||||
file_path = original_file_path # In case a file_path was provided and the user decide to cancel the open action
|
file_path = original_file_path # In case a file_path was provided and the user decide to cancel the open action
|
||||||
my_data = {}
|
my_data = {}
|
||||||
|
@ -19,7 +19,7 @@ from library.common_gui import (
|
|||||||
color_aug_changed,
|
color_aug_changed,
|
||||||
run_cmd_training,
|
run_cmd_training,
|
||||||
set_legacy_8bitadam,
|
set_legacy_8bitadam,
|
||||||
update_optimizer,
|
my_data,
|
||||||
)
|
)
|
||||||
from library.tensorboard_gui import (
|
from library.tensorboard_gui import (
|
||||||
gradio_tensorboard,
|
gradio_tensorboard,
|
||||||
@ -216,7 +216,7 @@ def open_config_file(
|
|||||||
my_data_db = json.load(f)
|
my_data_db = json.load(f)
|
||||||
print('Loading config...')
|
print('Loading config...')
|
||||||
# Update values to fix deprecated use_8bit_adam checkbox and set appropriate optimizer if it is set to True
|
# Update values to fix deprecated use_8bit_adam checkbox and set appropriate optimizer if it is set to True
|
||||||
my_data = update_optimizer(my_data)
|
my_data = my_data(my_data)
|
||||||
else:
|
else:
|
||||||
file_path = original_file_path # In case a file_path was provided and the user decide to cancel the open action
|
file_path = original_file_path # In case a file_path was provided and the user decide to cancel the open action
|
||||||
my_data_db = {}
|
my_data_db = {}
|
||||||
|
@ -10,10 +10,14 @@ save_style_symbol = '\U0001f4be' # 💾
|
|||||||
document_symbol = '\U0001F4C4' # 📄
|
document_symbol = '\U0001F4C4' # 📄
|
||||||
|
|
||||||
|
|
||||||
def update_optimizer(my_data):
|
def my_data(my_data):
|
||||||
if my_data.get('use_8bit_adam', False):
|
if my_data.get('use_8bit_adam', False):
|
||||||
my_data['optimizer'] = 'AdamW8bit'
|
my_data['optimizer'] = 'AdamW8bit'
|
||||||
my_data['use_8bit_adam'] = False
|
my_data['use_8bit_adam'] = False
|
||||||
|
|
||||||
|
if my_data.get('model_list', 'custom') == []:
|
||||||
|
print('Old config with empty model list. Setting to custom...')
|
||||||
|
my_data['model_list'] = 'custom'
|
||||||
return my_data
|
return my_data
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ from library.common_gui import (
|
|||||||
gradio_source_model,
|
gradio_source_model,
|
||||||
run_cmd_training,
|
run_cmd_training,
|
||||||
set_legacy_8bitadam,
|
set_legacy_8bitadam,
|
||||||
update_optimizer,
|
my_data,
|
||||||
)
|
)
|
||||||
from library.dreambooth_folder_creation_gui import (
|
from library.dreambooth_folder_creation_gui import (
|
||||||
gradio_dreambooth_folder_creation_tab,
|
gradio_dreambooth_folder_creation_tab,
|
||||||
@ -239,7 +239,7 @@ def open_configuration(
|
|||||||
my_data = json.load(f)
|
my_data = json.load(f)
|
||||||
print('Loading config...')
|
print('Loading config...')
|
||||||
# Update values to fix deprecated use_8bit_adam checkbox and set appropriate optimizer if it is set to True
|
# Update values to fix deprecated use_8bit_adam checkbox and set appropriate optimizer if it is set to True
|
||||||
my_data = update_optimizer(my_data)
|
my_data = my_data(my_data)
|
||||||
else:
|
else:
|
||||||
file_path = original_file_path # In case a file_path was provided and the user decide to cancel the open action
|
file_path = original_file_path # In case a file_path was provided and the user decide to cancel the open action
|
||||||
my_data = {}
|
my_data = {}
|
||||||
|
@ -25,7 +25,7 @@ from library.common_gui import (
|
|||||||
gradio_config,
|
gradio_config,
|
||||||
gradio_source_model,
|
gradio_source_model,
|
||||||
set_legacy_8bitadam,
|
set_legacy_8bitadam,
|
||||||
update_optimizer,
|
my_data,
|
||||||
)
|
)
|
||||||
from library.tensorboard_gui import (
|
from library.tensorboard_gui import (
|
||||||
gradio_tensorboard,
|
gradio_tensorboard,
|
||||||
@ -226,7 +226,7 @@ def open_configuration(
|
|||||||
my_data_db = json.load(f)
|
my_data_db = json.load(f)
|
||||||
print('Loading config...')
|
print('Loading config...')
|
||||||
# Update values to fix deprecated use_8bit_adam checkbox and set appropriate optimizer if it is set to True
|
# Update values to fix deprecated use_8bit_adam checkbox and set appropriate optimizer if it is set to True
|
||||||
my_data = update_optimizer(my_data)
|
my_data = my_data(my_data)
|
||||||
else:
|
else:
|
||||||
file_path = original_file_path # In case a file_path was provided and the user decide to cancel the open action
|
file_path = original_file_path # In case a file_path was provided and the user decide to cancel the open action
|
||||||
my_data_db = {}
|
my_data_db = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user