initLegacy static method
- @Deprecated('Use download() and init() separately instead')
Future<CactusVLM>
initLegacy(
{ - required String modelUrl,
- required String mmprojUrl,
- String? modelFilename,
- String? mmprojFilename,
- String? chatTemplate,
- int contextSize = 2048,
- int gpuLayers = 0,
- int threads = 4,
- CactusProgressCallback? onProgress,
- String? cactusToken,
})
Implementation
@Deprecated('Use download() and init() separately instead')
static Future<CactusVLM> initLegacy({
required String modelUrl,
required String mmprojUrl,
String? modelFilename,
String? mmprojFilename,
String? chatTemplate,
int contextSize = 2048,
int gpuLayers = 0,
int threads = 4,
CactusProgressCallback? onProgress,
String? cactusToken,
}) async {
final vlm = CactusVLM._();
if (cactusToken != null) {
setCactusToken(cactusToken);
}
final initParams = CactusInitParams(
modelUrl: modelUrl,
modelFilename: modelFilename,
mmprojUrl: mmprojUrl,
mmprojFilename: mmprojFilename,
chatTemplate: chatTemplate,
contextSize: contextSize,
gpuLayers: gpuLayers,
threads: threads,
onInitProgress: onProgress,
);
try {
vlm._context = await CactusContext.init(initParams);
} catch (e) {
CactusTelemetry.error(e, initParams);
rethrow;
}
return vlm;
}