run
Given a path to one or more pre-trained (.pt) MODELS, the run command launches a session for real-time model inference, via OSC.
Each model can be individually addressed via the <model_id> routeβe.g., the first model has ID of 1, the second has ID of 2, and so on.
The following OSC routes are available:
Input routesβ
Each model can receive OSC messages via the following routes:
/<model_id>/input <...features>: The current event, as a list of features, for the model to make the next prediction. The number of event features must match either the masked or unmasked event size. For example, if the first model was trained on xy coordinates, the OSC message would look like this:
/1/input -0.1 0.3
-
/<model_id>/sample: Request a random sample from the model's learned distribution, to be sent via the/<model_id>/outputroute. Useful for kicking off an auto-regressive loop. -
/<model_id>/reset: Resets the model's hidden state (i.e., it's context), as well as cancelling any scheduled predictions, if the model is temporal. -
/stop: Shuts down OSC server and stops session.
For input routes, /<model_id> can be optionally omitted as a way to address all models at once.
Output routesβ
The model output can be received via the following OSC routes:
/<model_id>/output <...features>: Model's predicted event (unmasked). The predicted event can be sent as is back to/inputfor auto-regression, even if the model is trained on masked features. For example, if three models are being run, and the third was trained to generate 4 values, the output OSC message could look something like this:
/3/output -0.1 0.4 -1.2 2.0
/status <int>: OSC server status.1when it's launched, and0when closed. This is automatically sent at the start and end of each session.
Note that, in some cases, running the model on CPU results in lower prediction latency.
Usageβ
hxmx run [MODELS]... [--in-port <INTEGER RANGE>] [--out-port <INTEGER RANGE>] [--address <TEXT>] [-d <CHOICE>] [--debug] [--help]
Argumentsβ
| Name | Type | Required | Default |
|---|---|---|---|
MODELS | path β must exist, file (multiple) | β |
Optionsβ
| Name | Type | Default | Description |
|---|---|---|---|
--in-port | integer [1000, 9999] | 8000 | Input OSC port. |
--out-port | integer [1000, 9999] | 9000 | Output OSC port. |
--address | string | 127.0.0.1 | OSC IP address |
--device, -d | choice (auto|cpu| ...) | cpu | Computing device. To list all available devices, run hxmx devices. |
--debug | boolean | False | Debug mode. Includes traceback when an error is raised. |
-h, --help | boolean | False | Open web documentation in browser. |