Skip to content

Commit f2ce9d3

Browse files
ermolenkodevintellij-monorepo-bot
authored andcommitted
JBAI-10776: Disabled ML-based quick fix imports ranking
Set the registry key to the “DISABLED” state. We’re doing this due to an unclear issue with model loading that some users have experienced. We encountered this problem specifically with JetEntry ML models in production. For more details, visit https://youtrack.jetbrains.com/issue/LLM-16032. (cherry picked from commit 45b7cafa8df1199cdfb15a7c69b8ee87cff74f05) IJ-CR-161529 GitOrigin-RevId: be502b2b59c449011af0a7f8a2bc886ef152263b
1 parent e867e11 commit f2ce9d3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

python/intellij.python.ml.features/resources/intellij.python.ml.features.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<statistics.counterUsagesCollector implementationClass="com.intellij.python.ml.features.imports.PyCharmImportsRankingLogs"/>
44
<registryKey
55
key="quickfix.ranking.ml"
6-
defaultValue="[IN_EXPERIMENT*|ENABLED|DISABLED]"
6+
defaultValue="[IN_EXPERIMENT|ENABLED|DISABLED*]"
77
description="Enable ML ranking in quick fix for missing imports"/>
88
<postStartupActivity implementation="com.intellij.python.ml.features.imports.QuickfixRankingModelLoading"/>
99
<applicationService serviceInterface="com.jetbrains.python.codeInsight.imports.ImportChooser"

python/intellij.python.ml.features/src/com/intellij/python/ml/features/imports/mlModel.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import com.jetbrains.ml.api.model.MLModel
1313
import com.jetbrains.ml.api.model.MLModelLoader
1414
import com.jetbrains.ml.models.PythonImportsRankingModelHolder
1515
import com.jetbrains.ml.tools.model.MLModelLoaders
16+
import com.intellij.openapi.diagnostic.thisLogger
1617
import com.jetbrains.ml.tools.model.ModelDistributionReaders
1718
import com.jetbrains.ml.tools.model.catboost.CatBoostDistributionFormat
1819
import com.jetbrains.ml.tools.model.suspendable.MLModelSuspendableService
@@ -30,7 +31,13 @@ class ImportsRankingModelService : MLModelSuspendableService<MLModel<Double>, Do
3031

3132
private class QuickfixRankingModelLoading : ProjectActivity {
3233
override suspend fun execute(project: Project) {
33-
service<ImportsRankingModelService>().loadModel()
34+
val rankingStatus = service<FinalImportRankingStatusService>().status
35+
if (rankingStatus is FinalImportRankingStatus.Disabled) return
36+
try {
37+
service<ImportsRankingModelService>().loadModel()
38+
} catch (e: RuntimeException) {
39+
thisLogger().error("Failed to load python imports ranking model", e)
40+
}
3441
}
3542
}
3643

0 commit comments

Comments
 (0)