resolveModelFilePath method
Resolve the actual model file path for loading. For single-file models (LlamaCpp), finds the actual .gguf file. For directory-based models (ONNX), returns the folder.
Implementation
Future<String?> resolveModelFilePath(ModelInfo model) async {
final modelFolder = getModelFolder(model.id, model.framework);
if (modelFolder == null) return null;
// For ONNX models (directory-based), find the model directory
if (model.framework == InferenceFramework.onnx) {
return _resolveONNXModelPath(modelFolder, model.id);
}
// For single-file models (LlamaCpp), find the actual file
return _resolveSingleFileModelPath(modelFolder, model);
}