CLI Reference
Global options
--debug
: Show logs for debugging.--help (-h)
: Show the help message and exit.
build
This command is for containerizing your model.
will create a docker image withtungsten_model.py
in the current directory.
Options
--name (-n)
: Name of the model in<repo name>[:<tag>]
format- Default:
BUILD_DIRECTORY_NAME:MODEL_ID
(e.g.current-directory:41ea3bf
)
- Default:
--model-module (-m)
: Model module (e.g.,some.example.module
)- Default:
tungsten_model
- Default:
--model-class (-c)
: Model class (e.g.,MyModel
)- Default: the class decorated with
tungstenkit.define_model
- Default: the class decorated with
--copy-files
: Copy files to the container in<src in host>:<dest in container>
format
models
The models
command displays all the available models.
serve
The serve
command runs a REST API server with a model.
If you want to run with the latest model in a repository, you can omit the tag.
If you want to run with the latest model, you can omit the model name.
Options
--port (-p)
: Bind socket to this port.- Default:
3000
- Default:
--batch-size
: Max batch size for adaptive batching.- Default: Declared value in
tungsten_model.py
- Default: Declared value in
--log-level
: Log level of the server.- Default:
info
- Available values:
trace
,debug
,info
,warning
,error
- Default:
demo
The demo
command runs an interactive web demo with a model.
If you want to run with the latest model in a repository, you can omit the tag.
If you want to run with the latest model, you can omit the model name.
Options
--port (-p)
: The port on which the demo server will listen.- Default:
3300
- Default:
--host
: The host on which the demo server will listen- Default:
localhost
- Default:
--batch-size
: Max batch size for adaptive batching.- Default: Declared value in
tungsten_model.py
- Default: Declared value in
--log-level
: Log level of the server.- Default:
info
- Available values:
trace
,debug
,info
,warning
,error
- Default:
predict
This command is for running a prediction with a model.
Options
--input (-i)
: Input field in the format of<NAME>=<VALUE>
--output-file-dir
: Output file directory- Default:
.
- Default:
tag
The tag
command adds a new name of a model.
remove
The remove
command removes a model.
clear
The clear
command removes all models.
If you want to remove all models in a repository (e.g. all models whose name starts with mymodel
), you can put the repository name.
login
This command is for logging in to tungsten.run.
push
This command is for pushing a model to tungsten.run.
Before running this command, you should login to tungsten.run using login
command.
If you already logged in with the username of exampleuser
, the above command is equivalent to:
If you want to push the latest model, you can omit the model name.
pull
This command is for pulling a model from tungsten.run.