Skip to content

Commit

Permalink
Merge pull request NVIDIA#6 from soltysh/finish_cli
Browse files Browse the repository at this point in the history
Complete CLI setup
  • Loading branch information
soltysh authored Feb 23, 2024
2 parents e778cec + c56ab3f commit 89f23d3
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 18 deletions.
44 changes: 38 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,38 @@ This is the command-line interface for TBD...
* MacOS
* 14.x with M1/M2/M3 (Metal/GPU)

## Quickstart
## Using

To install from source, clone this repo.

```shell
cd <repo root>
python3 -m venv venv
source venv/bin/activate
pip install .
```

This will install `lab` binary in `venv/bin/lab`, which will allow you to run it:

```shell
$ lab
Usage: lab [OPTIONS] COMMAND [ARGS]...

CLI for interacting with labrador

Options:
--help Show this message and exit.

Commands:
chat Run a chat using the modified model
generate Generates synthetic data to enhance your example data
init Initializes environment for labrador
serve Start a local server
test Perform rudimentary tests of the model
train Trains labrador model
```

## Development

> TODO: run in a project folder using `pip this` from PyPI
Expand All @@ -18,6 +49,7 @@ To run from source, clone this repo.
```shell
cd <repo root>
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

Expand All @@ -27,11 +59,11 @@ Always be sure to activate the venv in your working shell.
source venv/bin/activate
```

Run the CLI:
Running development version:

```ShellSession
(venv) $ cli/lab.py
Usage: lab.py [OPTIONS] COMMAND [ARGS]...
```
$ python -m cli
Usage: python -m cli [OPTIONS] COMMAND [ARGS]...
CLI for interacting with labrador
Expand All @@ -42,11 +74,11 @@ Commands:
chat Run a chat using the modified model
generate Generates synthetic data to enhance your example data
init Initializes environment for labrador
serve Start a local server
test Perform rudimentary tests of the model
train Trains labrador model
```


## Inferencing Models

This repo provides instructions on how to inference models as follows:
Expand Down
3 changes: 1 addition & 2 deletions cli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from cli import lab

if __name__ == "__main__":
lab.cli()
lab.cli()
8 changes: 1 addition & 7 deletions cli/lab.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

import click
from generator.generate_data import generate_data
from .generator.generate_data import generate_data

@click.group()
def cli():
Expand Down Expand Up @@ -39,7 +37,3 @@ def test():
def chat():
"""Run a chat using the modified model"""
click.echo("# chat TBD")


if __name__ == "__main__":
cli()
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.0.1"
authors = [
{ name="TBD", email="jon@example.com" },
]
description = "CLI for open-labrador"
description = "CLI for interacting with labrador"
readme = "README.md"
requires-python = ">=3.9"
classifiers = [
Expand All @@ -20,5 +20,11 @@ classifiers = [
Homepage = "https://github.com/open-labrador/cli"
Issues = "https://github.com/open-labrador/cli/issues"

[console_scripts]
cli = "cli.cli"
[project.scripts]
# defines lab executable
lab = "cli.lab:cli"

[tool.setuptools.packages.find]
# defines where to look for sub-packages
where = ["cli"]

0 comments on commit 89f23d3

Please sign in to comment.