<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/nlp/serving/serving_modules.py#L414-L460) |

The export module for the translation task.

Inherits From: [`ExportModule`](https://www.tensorflow.org/api_docs/python/tfm/core/export_base/ExportModule)

    tfm.nlp.serving_modules.Translation(
        params, model: tf_keras.Model, inference_step=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `params` | A dataclass for parameters to the module. |
| `model` | A model instance which contains weights and forward computation. |
| `inference_step` | An optional callable to forward-pass the model. If not specified, it creates a parital function with `model` as an required kwarg. |
| `preprocessor` | An optional callable to preprocess the inputs. |
| `postprocessor` | An optional callable to postprocess the model outputs. |

<br />

## Child Classes

[`class Params`](https://www.tensorflow.org/api_docs/python/tfm/nlp/serving_modules/Translation/Params)

## Methods

### `get_inference_signatures`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/official/nlp/serving/serving_modules.py#L448-L460)

    get_inference_signatures(
        function_keys: Dict[Text, Text]
    )

Get defined function signatures.

### `serve`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/official/nlp/serving/serving_modules.py#L438-L440)

    @tf.function
    serve(
        inputs
    ) -> Dict[str, tf.Tensor]

### `serve_text`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/official/nlp/serving/serving_modules.py#L442-L446)

    @tf.function
    serve_text(
        text: tf.Tensor
    ) -> Dict[str, tf.Tensor]