Disable debug flag

This commit is contained in:
Aleksandras Kostarevas 2023-11-21 20:33:21 +02:00
parent cd3d5a284f
commit 001f1eb442
3 changed files with 9 additions and 9 deletions

View File

@ -296,7 +296,7 @@ public class LanguageModelFacilitator(
val lastIdx = wordCtx.lastIndexOf(committedNgramCtx) val lastIdx = wordCtx.lastIndexOf(committedNgramCtx)
if(lastIdx == -1) { if(lastIdx == -1) {
println("addToHistory: extraction failed, couldn't find ngram ctx in full ctx") //println("addToHistory: extraction failed, couldn't find ngram ctx in full ctx")
return return
} }
@ -304,7 +304,7 @@ public class LanguageModelFacilitator(
lastIdx + committedNgramCtx.length lastIdx + committedNgramCtx.length
) )
if(misspelledWord.isNotBlank() && (!(misspelledWord.startsWith(" ") || committedNgramCtx == " ") || misspelledWord.endsWith(" ") || misspelledWord.trim().contains(" "))) { if(misspelledWord.isNotBlank() && (!(misspelledWord.startsWith(" ") || committedNgramCtx == " ") || misspelledWord.endsWith(" ") || misspelledWord.trim().contains(" "))) {
println("addToHistory: extraction failed bad context. wordCtx=[$wordCtx] -- committedNgramCtx=[$committedNgramCtx] -- word=[$word] -- fullNgram=[$ngramContext]") //println("addToHistory: extraction failed bad context. wordCtx=[$wordCtx] -- committedNgramCtx=[$committedNgramCtx] -- word=[$word] -- fullNgram=[$ngramContext]")
return return
} }
@ -336,7 +336,7 @@ public class LanguageModelFacilitator(
} }
historyLog.add(logToAdd) historyLog.add(logToAdd)
println("addToHistory: Adding $logToAdd") //println("addToHistory: Adding $logToAdd")
} }
public fun unlearnFromHistory( public fun unlearnFromHistory(
@ -358,9 +358,9 @@ public class LanguageModelFacilitator(
} }
if(logToRemove == -1) { if(logToRemove == -1) {
println("addToHistory: UNLEARN Couldn't find key $keyToSearch") //println("addToHistory: UNLEARN Couldn't find key $keyToSearch")
} else { } else {
println("addToHistory: Unlearning ${historyLog[logToRemove]}") //println("addToHistory: Unlearning ${historyLog[logToRemove]}")
historyLog.removeAt(logToRemove) historyLog.removeAt(logToRemove)
} }
} }

View File

@ -19,7 +19,7 @@ LOCAL_ARM_NEON := true
############ some local flags ############ some local flags
# If you change any of those flags, you need to rebuild both libjni_latinime_common_static # If you change any of those flags, you need to rebuild both libjni_latinime_common_static
# and the shared library that uses libjni_latinime_common_static. # and the shared library that uses libjni_latinime_common_static.
FLAG_DBG ?= true FLAG_DBG ?= false
FLAG_DO_PROFILE ?= false FLAG_DO_PROFILE ?= false
###################################### ######################################

View File

@ -136,12 +136,12 @@ namespace latinime {
// TODO: Callback for progress // TODO: Callback for progress
static void xlm_AdapterTrainer_train(JNIEnv *env, jobject instance, jlong statePtr) { static void xlm_AdapterTrainer_train(JNIEnv *env, jobject instance, jlong statePtr) {
jclass clazz = env->GetObjectClass(instance); jclass clazz = env->GetObjectClass(instance);
assert(clazz); ASSERT(clazz);
jmethodID progressMethodId = env->GetMethodID(clazz, "emitProgress", "(F)V"); jmethodID progressMethodId = env->GetMethodID(clazz, "emitProgress", "(F)V");
jmethodID lossMethodId = env->GetMethodID(clazz, "emitLoss", "(F)V"); jmethodID lossMethodId = env->GetMethodID(clazz, "emitLoss", "(F)V");
assert(progressMethodId); ASSERT(progressMethodId);
assert(lossMethodId); ASSERT(lossMethodId);
auto *state = reinterpret_cast<AdapterTrainerState *>(statePtr); auto *state = reinterpret_cast<AdapterTrainerState *>(statePtr);
state->env = env; state->env = env;