# InterpreterFactory

```
class InterpreterFactory
```

*** ** * ** ***

Factory for constructing InterpreterApi instances.

Deprecated; please use the InterpreterApi.create method instead.

## Summary

| ### Public constructors |
|---|
| `[InterpreterFactory](https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterFactory#InterpreterFactory())()` |

| ### Public functions |
|---|---|
| `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi!` | `[create](https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterFactory#create(java.nio.ByteBuffer,org.tensorflow.lite.InterpreterApi.Options))(byteBuffer: https://developers.google.com/edge/api/litert/kotlin/java/nio/ByteBuffer, options: https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options!)` Constructs an `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi` instance, using the specified model and options. |
| `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi!` | `[create](https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterFactory#create(java.io.File,org.tensorflow.lite.InterpreterApi.Options))(modelFile: https://developers.google.com/edge/api/litert/kotlin/java/io/File, options: https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options!)` Constructs an `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi` instance, using the specified model and options. |

## Public constructors

### InterpreterFactory

```
[InterpreterFactory](https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterFactory#InterpreterFactory())()
```

## Public functions

### create

```
fun [create](https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterFactory#create(java.nio.ByteBuffer,org.tensorflow.lite.InterpreterApi.Options))(byteBuffer: ByteBuffer, options: InterpreterApi.Options!): InterpreterApi!
```

Constructs an `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi` instance, using the specified model and options. The model will be read from a `ByteBuffer`.

| Parameters |
|---|---|
| `byteBuffer: https://developers.google.com/edge/api/litert/kotlin/java/nio/ByteBuffer` | A pre-trained TF Lite model, in binary serialized form. The ByteBuffer should not be modified after the construction of an `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi` instance. The ` ByteBuffer` can be either a `MappedByteBuffer` that memory-maps a model file, or a direct `ByteBuffer` of nativeOrder() that contains the bytes content of a model. |
| `options: https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options!` | A set of options for customizing interpreter behavior. |

| Throws |
|---|---|
| `https://developers.google.com/edge/api/litert/kotlin/java/lang/IllegalArgumentException` | if `byteBuffer` is not a `MappedByteBuffer` nor a direct `ByteBuffer` of nativeOrder. |

### create

```
fun [create](https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterFactory#create(java.io.File,org.tensorflow.lite.InterpreterApi.Options))(modelFile: File, options: InterpreterApi.Options!): InterpreterApi!
```

Constructs an `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi` instance, using the specified model and options. The model will be loaded from a file.

| Parameters |
|---|---|
| `modelFile: https://developers.google.com/edge/api/litert/kotlin/java/io/File` | A file containing a pre-trained TF Lite model. |
| `options: https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options!` | A set of options for customizing interpreter behavior. |

| Throws |
|---|---|
| `https://developers.google.com/edge/api/litert/kotlin/java/lang/IllegalArgumentException` | if `modelFile` does not encode a valid TensorFlow Lite model. |