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

Fix typing on optional strings #5727

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion ml-agents/mlagents/trainers/directory_utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
from typing import Optional
from mlagents.trainers.exception import UnityTrainerException
from mlagents.trainers.settings import TrainerSettings
from mlagents.trainers.model_saver.torch_model_saver import DEFAULT_CHECKPOINT_NAME


def validate_existing_directories(
output_path: str, resume: bool, force: bool, init_path: str = None
output_path: str, resume: bool, force: bool, init_path: Optional[str] = None
) -> None:
"""
Validates that if the run_id model exists, we do not overwrite it unless --force is specified.
Expand Down
4 changes: 2 additions & 2 deletions ml-agents/mlagents/trainers/trainer/trainer_factory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import Dict
from typing import Dict, Optional

from mlagents_envs.logging_util import get_logger
from mlagents.trainers.environment_parameter_manager import EnvironmentParameterManager
Expand All @@ -25,7 +25,7 @@ def __init__(
load_model: bool,
seed: int,
param_manager: EnvironmentParameterManager,
init_path: str = None,
init_path: Optional[str] = None,
multi_gpu: bool = False,
):
"""
Expand Down