Skip to content

Commit

Permalink
updated default values for required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov721 committed Nov 6, 2024
1 parent 726b46d commit 406035d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
9 changes: 3 additions & 6 deletions modelconverter/cli/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,19 +294,16 @@ class ModelPrecision(str, Enum):
]

DescriptionOption = Annotated[
Optional[str],
str,
typer.Option(help="Description of the model", show_default=False),
]

DescriptionShortOption = Annotated[
Optional[str],
str,
typer.Option(help="Short description of the model", show_default=False),
]

LicenseTypeOption = Annotated[
Optional[License],
typer.Option(help="License type.", show_default=False),
]
LicenseTypeOption = Annotated[License, typer.Option(help="License type.")]

IsPublicOption = Annotated[
bool,
Expand Down
17 changes: 9 additions & 8 deletions modelconverter/hub/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
print_hub_resource_info,
request_info,
)
from modelconverter.cli.types import License

from .hub_requests import Request

Expand Down Expand Up @@ -100,7 +101,7 @@ def model_ls(
team_id: TeamIDOption = None,
tasks: TasksOption = None,
user_id: UserIDOption = None,
license_type: LicenseTypeOption = None,
license_type: LicenseTypeOption = License.UNDEFINED,
is_public: IsPublicOption = True,
slug: SlugOption = None,
project_id: ProjectIDOption = None,
Expand Down Expand Up @@ -160,10 +161,10 @@ def model_info(
@model.command(name="create")
def model_create(
name: NameArgument,
license_type: LicenseTypeOption = None,
license_type: LicenseTypeOption = License.UNDEFINED,
is_public: IsPublicOption = True,
description: DescriptionOption = None,
description_short: DescriptionShortOption = None,
description: DescriptionOption = "<empty>",
description_short: DescriptionShortOption = "<empty>",
architecture_id: ArchitectureIDOption = None,
tasks: TasksOption = None,
links: LinksOption = None,
Expand Down Expand Up @@ -247,7 +248,7 @@ def version_create(
name: NameArgument,
model_id: ModelIDRequired,
version: HubVersionRequired,
description: DescriptionOption = None,
description: DescriptionOption = "<empty>",
repository_url: RepositoryUrlOption = None,
commit_hash: CommitHashOption = None,
domain: DomainOption = None,
Expand Down Expand Up @@ -440,11 +441,11 @@ def upload(file: Path, model_instance_id: ModelInstanceIDArgument):
def convert(
target: TargetArgument,
name: NameArgument,
license_type: LicenseTypeOption = None,
license_type: LicenseTypeOption = License.UNDEFINED,
path: PathOption = None,
is_public: IsPublicOption = True,
description_short: DescriptionShortOption = None,
description: DescriptionOption = None,
description_short: DescriptionShortOption = "<empty>",
description: DescriptionOption = "<empty>",
architecture_id: ArchitectureIDOption = None,
tasks: TasksOption = None,
links: LinksOption = None,
Expand Down

0 comments on commit 406035d

Please sign in to comment.