Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the issue where the "Configuration file already exists" warning blocks the batch jobs #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/paramit/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,20 @@ def main():
print(
f"{YELLOW}Warning: Configuration file {config_path} already exists{RESET}"
)
overwrite = input("Do you want to overwrite it? (y/n): ")
if overwrite.lower() == "y":
overwrite_file = False

if "overwrite" in hyperparameters:
if hyperparameters["overwrite"].values[0].strip().lower() in ["y", "yes"]:
overwrite_file = True
# Remove "overwrite" from hyperparameters if it exists
del hyperparameters["overwrite"]
else:
overwrite = input("Do you want to overwrite it? (y/n): ").strip().lower()
if overwrite == "y":
overwrite_file = True

# If overwrite is allowed, generate and write the config file
if overwrite_file:
generated_config = generate_config_file(tree, path)

with open(config_path, "wb") as f:
Expand All @@ -660,6 +672,8 @@ def main():
orig_script_path = config["meta"]["script_path"]

experiment_configs = generate_configs_from_hyperparameters(config, hyperparameters)



if len(experiment_configs) > 100:
print(f"{YELLOW}Warning: Running {len(experiment_configs)} experiments{RESET}")
Expand Down