# AI : Faceswap : CLI : tools model
```
python tools.py model -m MODELDIR -j ...
```
## Options
```
-m|--model-dir DIR Model directory. A directory containing the model you wish to perform an action on.
-j|--job {inference,nan-scan,restore}
Choose which action you want to perform.
- inference - Create an inference only copy of the model. Strips any layers from the model which are only required for training.
NB: This is for exporting the model for use in external applications. Inference generated models cannot be used within Faceswap.
See the 'format' option for specifying the model output format.
- nan-scan - Scan the model file for NaNs or Infs (invalid data).
- restore - Restore a model from backup.
-f|--format {h5,saved-model}
The format to save the model as. Note: Only used for 'inference' job.
- h5 - Standard Keras H5 format. Does not store any custom layer information. Layers will need to be loaded from Faceswap to use.
- saved-model - Tensorflow's Saved Model format. Contains all information required to load the model outside of Faceswap.
-s|--swap-model Only used for 'inference' job. Generate the inference model for B -> A instead of A -> B.
```