deleteLoraWeights method
Legacy API: Removes LoRA weights from current model
Implementation
@override
Future<void> deleteLoraWeights() async {
await _ensureInitialized();
if (_activeInferenceModel == null) {
throw Exception('No active inference model to remove LoRA weights from');
}
// Create updated spec without LoRA
final current = _activeInferenceModel as InferenceModelSpec;
final updatedSpec = InferenceModelSpec.fromLegacyUrl(
name: current.name,
modelUrl: current.modelUrl,
loraUrl: null, // Remove LoRA
replacePolicy: current.replacePolicy,
);
await _ensureModelReadySpec(updatedSpec);
setActiveModel(updatedSpec);
}