TfLiteInterpreter class
High-level Dart wrapper around the TFLite C API.
Loads a .tflite model and runs inference with Int32 input / Float32 output.
Auto-detects input sequence length and output embedding dimension from the model.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputSequenceLength → int
-
Input tensor shape:
1, inputSequenceLengthfinal - outputDimension → int
-
Output tensor shape:
1, outputDimension(typically 768)final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void - Release all native resources.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
List< int> tokenIds) → List<double> - Run inference with Int32 token IDs, returns Float32 embedding vector.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromFile(
String modelPath, {int numThreads = 4, String? libraryPath}) → TfLiteInterpreter -
Create an interpreter from a
.tflitemodel file.