ML in SE: account for possible json processing errors when reading embedding model artifacts

GitOrigin-RevId: e574db3508bef72f9a56004c4bff694157ca5520
This commit is contained in:
Evgeny Abramov
2024-02-20 03:59:56 +02:00
committed by intellij-monorepo-bot
parent 43a2ec67fa
commit 644ed69469

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.platform.ml.embeddings.services
import com.fasterxml.jackson.core.JsonProcessingException
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.components.Service
@@ -48,6 +49,10 @@ class LocalEmbeddingServiceProvider {
logger.warn("Local embedding model artifacts not found: $e")
null
}
catch (e: JsonProcessingException) {
logger.warn("Local embedding model artifacts JSON processing failure")
null
}
}
localServiceRef = SoftReference(service)
}