Views
No views yet
| Property | Value |
|---|---|
| Input Sequence Length | Up to 256 word pieces (longer text is truncated) |
| Output Dimensions | 384-dimensional dense vectors |
| Model Size | ~22M parameters (TFLite optimized) |
| Base Architecture | 6-layer MiniLM encoder |
| Pooling Strategy | Mean pooling with attention mask |
| Normalization | L2 normalized embeddings |
1// Load the TFLite model in your Android app
2val interpreter = Interpreter(loadModelFile())
3
4// Prepare input tensors
5val inputShape = intArrayOf(1, maxSequenceLength)
6val inputBuffer = TensorBuffer.createFixedSize(inputShape, DataType.INT32)
7
8// Run inference
9interpreter.run(inputBuffer.buffer, outputBuffer.buffer)1// Use with tflite_flutter package
2import 'package:tflite_flutter/tflite_flutter.dart';
3
4// Load and run inference
5final interpreter = await Interpreter.fromAsset('all_minilm_l6_v2.tflite');
6final output = List.filled(384, 0.0).reshape([1, 384]);
7interpreter.run(input, output);1# Verify model outputs match original
2import tensorflow as tf
3
4# Load TFLite model
5interpreter = tf.lite.Interpreter(model_path="model.tflite")
6interpreter.allocate_tensors()
7
8# Get input and output tensors
9input_details = interpreter.get_input_details()
10output_details = interpreter.get_output_details()
11
12# Run inference
13interpreter.set_tensor(input_details[0]['index'], input_data)
14interpreter.invoke()
15output_data = interpreter.get_tensor(output_details[0]['index'])| Metric | Value |
|---|---|
| Embedding Speed (CPU) | ~15ms per 1K tokens |
| Model Size | <50MB (TFLite format) |
| Memory Usage | Low memory footprint for mobile deployment |
| Accuracy | Maintains >95% similarity to original model outputs |