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

🚀 CLI #117

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions gradsflow/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2021 GradsFlow. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
32 changes: 32 additions & 0 deletions gradsflow/cli/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2021 GradsFlow. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import typer

from gradsflow import __version__
from gradsflow.cli import training

app = typer.Typer(
name="GRADSFLOW CLI 🚀",
add_completion=True,
)

app.add_typer(
training.app,
name="training",
)


@app.command()
def version():
typer.echo(f"Hey 👋! You're running gradsflow version={__version__} ✨")
42 changes: 42 additions & 0 deletions gradsflow/cli/training.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) 2021 GradsFlow. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Optional

import typer

from gradsflow.tasks.autotasks import available_tasks

app = typer.Typer()


@app.command()
def show_available_tasks():
"""
Auto-builds Docker image for chitra ModelServer
"""
typer.echo(available_tasks())


@app.command()
def auto_tune(
data_path: str,
task: str,
max_epochs: Optional[int] = None,
n_trials: int = 10,
timeout: int = 600,
):
# data = load_data()
# data = None
# autotask(data)
typer.echo("to be implemented!")
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ dev = [
test = [
"pytest",
"coverage",
"pytest-sugar"
"pytest-sugar",
"typer"
]

[tool.isort]
profile = "black"

[tool.black]
line_length = 120

[tool.flit.scripts]
gradsflow = "gradsflow.cli.main:app"