Skip to content

Commit a1fa387

Browse files
committed
Disable latency test for UnityTranslateLib
1 parent 4a8a725 commit a1fa387

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/main/kotlin/xyz/bluspring/unitytranslate/translator/LibreTranslateInstance.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ open class LibreTranslateInstance(val url: String, var weightage: Int, val authK
2424
var currentlyTranslating = 0
2525

2626
init {
27+
runLatencyTest()
28+
}
29+
30+
open fun runLatencyTest() {
2731
val startTime = System.currentTimeMillis()
2832
runBlocking {
2933
if (translate("Latency test for UnityTranslate", Language.ENGLISH, Language.SPANISH) == null)

src/main/kotlin/xyz/bluspring/unitytranslate/translator/library/UnityTranslateLibInstance.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class UnityTranslateLibInstance private constructor(): LibreTranslateInstance(""
2525
return cachedSupportedLanguages
2626
}
2727

28+
override fun runLatencyTest() {
29+
}
30+
2831
override suspend fun translate(from: String, to: String, request: String): String {
2932
return library.getTranslator(from, to, TranslatorManager.checkSupportsCuda()).batchTranslate(listOf(request)).getOrNull(0) ?: request
3033
}

0 commit comments

Comments
 (0)