From 7ca404a081c9d0e299cc207cf5f17d9911d1c758 Mon Sep 17 00:00:00 2001 From: Alex Arvanitidis Date: Thu, 21 Nov 2024 16:24:11 +0200 Subject: [PATCH] feat: send properly base64 encoded for new r models --- src/main/kotlin/org/jaqpot/api/mapper/ModelMapper.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/org/jaqpot/api/mapper/ModelMapper.kt b/src/main/kotlin/org/jaqpot/api/mapper/ModelMapper.kt index d5a97ba..82a4d45 100644 --- a/src/main/kotlin/org/jaqpot/api/mapper/ModelMapper.kt +++ b/src/main/kotlin/org/jaqpot/api/mapper/ModelMapper.kt @@ -131,15 +131,11 @@ private fun Model.encodeRawPreprocessor(rawPreprocessor: ByteArray?): String? { } fun Model.encodeRawModel(rawModel: ByteArray): String { - return if (isRModel()) { + return if (isRModel() && isLegacyModel()) { // https://upci-ntua.atlassian.net/browse/JAQPOT-199 // R models require special deserialization and base64 messes up the model rawModel.decodeToString() - } -// else if (isLegacyModel()) { -// String(rawModel) -// } - else { + } else { Base64.getEncoder().encodeToString(rawModel) } }