createModel abstract method
Future<InferenceModel>
createModel({
- required ModelType modelType,
- ModelFileType fileType = ModelFileType.task,
- int maxTokens = 1024,
- PreferredBackend? preferredBackend,
- List<
int> ? loraRanks, - int? maxNumImages,
- bool supportImage = false,
Creates and returns a new InferenceModel instance.
modelType
— model type to create.
maxTokens
— maximum context length for the model.
preferredBackend
— backend preference (e.g., CPU, GPU).
loraRanks
— optional supported LoRA ranks.
maxNumImages
— maximum number of images (for multimodal models).
supportImage
— whether the model supports images.
Implementation
Future<InferenceModel> createModel({
required ModelType modelType,
ModelFileType fileType = ModelFileType.task,
int maxTokens = 1024,
PreferredBackend? preferredBackend,
List<int>? loraRanks,
int? maxNumImages, // Add image support
bool supportImage = false, // Add image support flag
});