Merge pull request #185 from Lawrr/fix-model-autocomplete

Fix autocomplete replacing embedding and lora underscores with spaces
This commit is contained in:
pythongosssss
2024-02-10 17:10:04 +00:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -285,6 +285,7 @@ app.registerExtension({
words[v] = {
text: v,
info: () => new EmbeddingInfoDialog(emb).show("embeddings", emb),
use_replacer: false,
};
}
@@ -303,6 +304,7 @@ app.registerExtension({
words[v] = {
text: v,
info: () => new LoraInfoDialog(lora).show("loras", lora),
use_replacer: false,
};
}
+2 -1
View File
@@ -576,7 +576,8 @@ export class TextAreaAutoComplete {
onclick: () => {
this.el.focus();
let value = wordInfo.value ?? wordInfo.text;
if (TextAreaAutoComplete.replacer) {
const use_replacer = wordInfo.use_replacer ?? true;
if (TextAreaAutoComplete.replacer && use_replacer) {
value = TextAreaAutoComplete.replacer(value);
}
this.helper.insertAtCursor(value + this.separator, -before.length, wordInfo.caretOffset);