Skip to content

Commit

Permalink
fixed bug with trigger words not removing correctly on deselect
Browse files Browse the repository at this point in the history
  • Loading branch information
Metal079 committed Sep 30, 2024
1 parent b268b5e commit 822bdee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/home/options/options.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,11 @@ export class OptionsComponent implements OnInit {

// Remove the trigger prompt from the prompt input
if (lora.trigger_words) {
lora.trigger_words.forEach((element: String) => {
// sanitize trigger words
let trigger_words = lora.trigger_words;
trigger_words = trigger_words.map((word: string) => word.trim().toLowerCase());

trigger_words.forEach((element: String) => {
this.generationRequest.prompt = this.generationRequest.prompt.replace(', ' + element, '');
});
this.sharedService.setPrompt(this.generationRequest.prompt);
Expand Down

0 comments on commit 822bdee

Please sign in to comment.