add: support selecting saved configuration files and loading training parameters
Former-commit-id: 5c9b17c1dc9093da0ea813642bce9b5c9ae96274
This commit is contained in:
@@ -176,6 +176,18 @@ def list_output_dirs(model_name: str, finetuning_type: str, initial_dir: str) ->
|
||||
return gr.Dropdown(choices=output_dirs)
|
||||
|
||||
|
||||
def list_config_paths() -> "gr.Dropdown":
|
||||
"""
|
||||
Lists all the saved configuration files that can be loaded.
|
||||
"""
|
||||
if os.path.exists(DEFAULT_CONFIG_DIR) and os.path.isdir(DEFAULT_CONFIG_DIR):
|
||||
config_files = [file_name for file_name in os.listdir(DEFAULT_CONFIG_DIR) if file_name.endswith(".yaml")]
|
||||
else:
|
||||
config_files = []
|
||||
|
||||
return gr.Dropdown(choices=config_files)
|
||||
|
||||
|
||||
def check_output_dir(lang: str, model_name: str, finetuning_type: str, output_dir: str) -> None:
|
||||
r"""
|
||||
Check if output dir exists.
|
||||
|
||||
Reference in New Issue
Block a user