sillytavern 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +4 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/workflows/npm-publish.yml +32 -0
- package/Dockerfile +49 -0
- package/Start.bat +3 -0
- package/colab/GPU.ipynb +339 -0
- package/colab/extras_server.py +40 -0
- package/colab/globals.py +2 -0
- package/colab/models.py +77 -0
- package/docker/docker-compose.yml +12 -0
- package/docker/docker-entrypoint.sh +28 -0
- package/faq.md +208 -0
- package/package.json +49 -0
- package/poe-client.js +638 -0
- package/poe-test.js +21 -0
- package/poe_graphql/AddHumanMessageMutation.graphql +52 -0
- package/poe_graphql/AddMessageBreakMutation.graphql +17 -0
- package/poe_graphql/AutoSubscriptionMutation.graphql +7 -0
- package/poe_graphql/BioFragment.graphql +8 -0
- package/poe_graphql/ChatAddedSubscription.graphql +5 -0
- package/poe_graphql/ChatFragment.graphql +6 -0
- package/poe_graphql/ChatListPaginationQuery.graphql +316 -0
- package/poe_graphql/ChatPaginationQuery.graphql +26 -0
- package/poe_graphql/ChatViewQuery.graphql +8 -0
- package/poe_graphql/DeleteHumanMessagesMutation.graphql +7 -0
- package/poe_graphql/DeleteMessageMutation.graphql +7 -0
- package/poe_graphql/HandleFragment.graphql +8 -0
- package/poe_graphql/LoginWithVerificationCodeMutation.graphql +13 -0
- package/poe_graphql/MessageAddedSubscription.graphql +115 -0
- package/poe_graphql/MessageDeletedSubscription.graphql +8 -0
- package/poe_graphql/MessageFragment.graphql +13 -0
- package/poe_graphql/MessageRemoveVoteMutation.graphql +7 -0
- package/poe_graphql/MessageSetVoteMutation.graphql +7 -0
- package/poe_graphql/SendVerificationCodeForLoginMutation.graphql +12 -0
- package/poe_graphql/ShareMessagesMutation.graphql +9 -0
- package/poe_graphql/SignupWithVerificationCodeMutation.graphql +13 -0
- package/poe_graphql/StaleChatUpdateMutation.graphql +7 -0
- package/poe_graphql/SubscriptionsMutation.graphql +9 -0
- package/poe_graphql/SummarizePlainPostQuery.graphql +3 -0
- package/poe_graphql/SummarizeQuotePostQuery.graphql +3 -0
- package/poe_graphql/SummarizeSharePostQuery.graphql +3 -0
- package/poe_graphql/UserSnippetFragment.graphql +14 -0
- package/poe_graphql/ViewerInfoQuery.graphql +21 -0
- package/poe_graphql/ViewerMessageLimitUpdatedSubscription.graphql +81 -0
- package/poe_graphql/ViewerStateFragment.graphql +30 -0
- package/poe_graphql/ViewerStateUpdatedSubscription.graphql +63 -0
- package/public/KoboldAI Settings/Ace of Spades 13B.settings +22 -0
- package/public/KoboldAI Settings/Adventurer-NeoX-20B-Erebus.settings +54 -0
- package/public/KoboldAI Settings/Basic Coherence 13B.settings +22 -0
- package/public/KoboldAI Settings/Best Guess 6B.settings +22 -0
- package/public/KoboldAI Settings/Calibrated-Pygmalion-6b.settings +47 -0
- package/public/KoboldAI Settings/Classic-Pygmalion-2.7b.settings +46 -0
- package/public/KoboldAI Settings/Classic-Pygmalion-6b.settings +47 -0
- package/public/KoboldAI Settings/Coherent Creativity 6B.settings +22 -0
- package/public/KoboldAI Settings/Default-TavernAI.settings +22 -0
- package/public/KoboldAI Settings/DragonSlayer-Pygmalion-6b.settings +47 -0
- package/public/KoboldAI Settings/GPU-Pygmalion-6b.settings +47 -0
- package/public/KoboldAI Settings/Genesis 13B.settings +22 -0
- package/public/KoboldAI Settings/Godlike.settings +22 -0
- package/public/KoboldAI Settings/Good Winds.settings +22 -0
- package/public/KoboldAI Settings/Lancer-OPT-2.7B-Erebus.settings +54 -0
- package/public/KoboldAI Settings/Liminal Drift.settings +22 -0
- package/public/KoboldAI Settings/Low Rider 13B.settings +22 -0
- package/public/KoboldAI Settings/Luna Moth 6B.settings +22 -0
- package/public/KoboldAI Settings/Mayday.settings +22 -0
- package/public/KoboldAI Settings/Ouroboros.settings +22 -0
- package/public/KoboldAI Settings/Pleasing Results 6B.settings +22 -0
- package/public/KoboldAI Settings/Pro Writer 13B.settings +22 -0
- package/public/KoboldAI Settings/RA - Pygmalion-1.3b.settings +46 -0
- package/public/KoboldAI Settings/Storywriter 6B.settings +22 -0
- package/public/NovelAI Settings/Classic-Euterpe.settings +14 -0
- package/public/NovelAI Settings/Classic-Krake.settings +14 -0
- package/public/OpenAI Settings/Default.settings +15 -0
- package/public/TextGen Settings/Beam Search.settings +15 -0
- package/public/TextGen Settings/Contrastive Search.settings +15 -0
- package/public/TextGen Settings/Default.settings +15 -0
- package/public/TextGen Settings/Deterministic.settings +15 -0
- package/public/TextGen Settings/Kobold (Godlike).settings +15 -0
- package/public/TextGen Settings/Kobold (Liminal Drift).settings +15 -0
- package/public/TextGen Settings/Naive.settings +15 -0
- package/public/TextGen Settings/NovelAI (Best Guess).settings +15 -0
- package/public/TextGen Settings/NovelAI (Decadence).settings +15 -0
- package/public/TextGen Settings/NovelAI (Genesis).settings +15 -0
- package/public/TextGen Settings/NovelAI (Lycaenidae).settings +15 -0
- package/public/TextGen Settings/NovelAI (Ouroboros).settings +15 -0
- package/public/TextGen Settings/NovelAI (Pleasing Results).settings +15 -0
- package/public/TextGen Settings/NovelAI (Sphinx Moth).settings +15 -0
- package/public/TextGen Settings/NovelAI (Storywriter).settings +15 -0
- package/public/TextGen Settings/Pygmalion.settings +15 -0
- package/public/css/fontawesome.css +8488 -0
- package/public/css/notes.css +46 -0
- package/public/css/solid.css +24 -0
- package/public/favicon.ico +0 -0
- package/public/img/No-Image-Placeholder.svg +309 -0
- package/public/img/addbg3.png +0 -0
- package/public/img/ai4.png +0 -0
- package/public/img/apple-icon-114x114.png +0 -0
- package/public/img/apple-icon-144x144.png +0 -0
- package/public/img/apple-icon-57x57.png +0 -0
- package/public/img/apple-icon-72x72.png +0 -0
- package/public/img/book2.png +0 -0
- package/public/img/default-expressions/admiration.png +0 -0
- package/public/img/default-expressions/amusement.png +0 -0
- package/public/img/default-expressions/anger.png +0 -0
- package/public/img/default-expressions/annoyance.png +0 -0
- package/public/img/default-expressions/approval.png +0 -0
- package/public/img/default-expressions/caring.png +0 -0
- package/public/img/default-expressions/confusion.png +0 -0
- package/public/img/default-expressions/curiosity.png +0 -0
- package/public/img/default-expressions/desire.png +0 -0
- package/public/img/default-expressions/desire1.png +0 -0
- package/public/img/default-expressions/desire2.png +0 -0
- package/public/img/default-expressions/disappointment.png +0 -0
- package/public/img/default-expressions/disapproval.png +0 -0
- package/public/img/default-expressions/disgust.png +0 -0
- package/public/img/default-expressions/embarrassment.png +0 -0
- package/public/img/default-expressions/excitement.png +0 -0
- package/public/img/default-expressions/fear.png +0 -0
- package/public/img/default-expressions/gratitude.png +0 -0
- package/public/img/default-expressions/grief.png +0 -0
- package/public/img/default-expressions/joy.png +0 -0
- package/public/img/default-expressions/love.png +0 -0
- package/public/img/default-expressions/nervousness.png +0 -0
- package/public/img/default-expressions/neutral.png +0 -0
- package/public/img/default-expressions/optimism.png +0 -0
- package/public/img/default-expressions/pride.png +0 -0
- package/public/img/default-expressions/realization.png +0 -0
- package/public/img/default-expressions/relief.png +0 -0
- package/public/img/default-expressions/remorse.png +0 -0
- package/public/img/default-expressions/sadness.png +0 -0
- package/public/img/default-expressions/surprise.png +0 -0
- package/public/img/five.png +0 -0
- package/public/img/times-circle.svg +1 -0
- package/public/img/you.png +0 -0
- package/public/index.html +1899 -0
- package/public/notes/1.html +44 -0
- package/public/notes/1.png +0 -0
- package/public/notes/10.html +20 -0
- package/public/notes/11.html +33 -0
- package/public/notes/12.html +27 -0
- package/public/notes/13.html +29 -0
- package/public/notes/13_1.html +24 -0
- package/public/notes/13_2.html +25 -0
- package/public/notes/13_3.html +89 -0
- package/public/notes/14.html +30 -0
- package/public/notes/2.html +37 -0
- package/public/notes/2.png +0 -0
- package/public/notes/3.html +37 -0
- package/public/notes/4.html +105 -0
- package/public/notes/6.html +33 -0
- package/public/notes/7.html +40 -0
- package/public/notes/8.html +19 -0
- package/public/notes/9.html +46 -0
- package/public/notes/advanced_formatting.html +91 -0
- package/public/notes/group_reply_strategy.html +63 -0
- package/public/notes/message_sound.html +33 -0
- package/public/notes/multigen.html +36 -0
- package/public/notes/oai_api_key.html +37 -0
- package/public/notes/textgen_streaming.html +29 -0
- package/public/notes/token-limits.html +68 -0
- package/public/script.js +5131 -0
- package/public/scripts/RossAscends-mods.js +750 -0
- package/public/scripts/bookmarks.js +130 -0
- package/public/scripts/extensions/backgrounds/index.js +129 -0
- package/public/scripts/extensions/backgrounds/manifest.json +11 -0
- package/public/scripts/extensions/backgrounds/style.css +45 -0
- package/public/scripts/extensions/caption/index.js +117 -0
- package/public/scripts/extensions/caption/manifest.json +13 -0
- package/public/scripts/extensions/caption/style.css +23 -0
- package/public/scripts/extensions/dice/droll.js +108 -0
- package/public/scripts/extensions/dice/index.js +96 -0
- package/public/scripts/extensions/dice/manifest.json +11 -0
- package/public/scripts/extensions/dice/style.css +26 -0
- package/public/scripts/extensions/expressions/index.js +387 -0
- package/public/scripts/extensions/expressions/manifest.json +13 -0
- package/public/scripts/extensions/expressions/style.css +115 -0
- package/public/scripts/extensions/floating-prompt/index.js +151 -0
- package/public/scripts/extensions/floating-prompt/manifest.json +11 -0
- package/public/scripts/extensions/floating-prompt/style.css +19 -0
- package/public/scripts/extensions/memory/index.js +358 -0
- package/public/scripts/extensions/memory/manifest.json +13 -0
- package/public/scripts/extensions/memory/style.css +34 -0
- package/public/scripts/extensions.js +288 -0
- package/public/scripts/f-localStorage.js +27 -0
- package/public/scripts/gpt-2-3-tokenizer/README.md +28 -0
- package/public/scripts/gpt-2-3-tokenizer/encoder.js +1 -0
- package/public/scripts/gpt-2-3-tokenizer/mod.js +169 -0
- package/public/scripts/gpt-2-3-tokenizer/vocab.bpe.js +1 -0
- package/public/scripts/gpt-3-tokenizer/array-keyed-map.js +210 -0
- package/public/scripts/gpt-3-tokenizer/gpt3-tokenizer.js +271 -0
- package/public/scripts/gpt-3-tokenizer/gpt3-tokenizer.js.map +1 -0
- package/public/scripts/group-chats.js +899 -0
- package/public/scripts/horde.js +214 -0
- package/public/scripts/jquery-3.5.1.min.js +2 -0
- package/public/scripts/jquery-cookie-1.4.1.min.js +2 -0
- package/public/scripts/jquery.transit.min.js +1 -0
- package/public/scripts/kai-settings.js +179 -0
- package/public/scripts/nai-settings.js +108 -0
- package/public/scripts/openai.js +973 -0
- package/public/scripts/poe.js +360 -0
- package/public/scripts/popper.js +2008 -0
- package/public/scripts/popper.js.map +1 -0
- package/public/scripts/power-user.js +571 -0
- package/public/scripts/purify.min.js +3 -0
- package/public/scripts/purify.min.js.map +1 -0
- package/public/scripts/showdown.min.js +3 -0
- package/public/scripts/showdown.min.js.map +1 -0
- package/public/scripts/swiped-events.js +165 -0
- package/public/scripts/textgen-settings.js +194 -0
- package/public/scripts/toolcool-color-picker.js +87 -0
- package/public/scripts/utils.js +109 -0
- package/public/scripts/world-info.js +661 -0
- package/public/sounds/message.mp3 +0 -0
- package/public/style.css +3633 -0
- package/public/webfonts/NotoSans/NotoSans-Black.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-Black.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-BlackItalic.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-BlackItalic.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-Bold.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-Bold.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-BoldItalic.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-BoldItalic.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-ExtraBold.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-ExtraBold.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-ExtraBoldItalic.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-ExtraBoldItalic.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-ExtraLight.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-ExtraLight.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-ExtraLightItalic.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-ExtraLightItalic.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-Italic.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-Italic.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-Light.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-Light.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-LightItalic.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-LightItalic.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-Medium.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-Medium.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-MediumItalic.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-MediumItalic.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-Regular.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-Regular.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-SemiBold.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-SemiBold.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-SemiBoldItalic.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-SemiBoldItalic.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-Thin.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-Thin.woff2 +0 -0
- package/public/webfonts/NotoSans/NotoSans-ThinItalic.woff +0 -0
- package/public/webfonts/NotoSans/NotoSans-ThinItalic.woff2 +0 -0
- package/public/webfonts/NotoSans/stylesheet.css +162 -0
- package/public/webfonts/fa-solid-900.ttf +0 -0
- package/public/webfonts/fa-solid-900.woff2 +0 -0
- package/readme.md +187 -0
- package/server.js +2593 -0
- package/start.sh +24 -0
- package/tools/charaverter/main.mjs +110 -0
- package/tools/charaverter/package.json +10 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
saveSettingsDebounced,
|
|
3
|
+
getStoppingStrings,
|
|
4
|
+
} from "../script.js";
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
kai_settings,
|
|
8
|
+
loadKoboldSettings,
|
|
9
|
+
formatKoboldUrl,
|
|
10
|
+
getKoboldGenerationData,
|
|
11
|
+
canUseKoboldStopSequence,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const kai_settings = {
|
|
15
|
+
temp: 1,
|
|
16
|
+
rep_pen: 1,
|
|
17
|
+
rep_pen_range: 0,
|
|
18
|
+
top_p: 1,
|
|
19
|
+
top_a: 1,
|
|
20
|
+
top_k: 0,
|
|
21
|
+
typical: 1,
|
|
22
|
+
tfs: 1,
|
|
23
|
+
rep_pen_slope: 0.9,
|
|
24
|
+
single_line: false,
|
|
25
|
+
use_stop_sequence: false,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const MIN_STOP_SEQUENCE_VERSION = '1.2.2';
|
|
29
|
+
|
|
30
|
+
function formatKoboldUrl(value) {
|
|
31
|
+
try {
|
|
32
|
+
const url = new URL(value);
|
|
33
|
+
url.pathname = '/api';
|
|
34
|
+
return url.toString();
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function loadKoboldSettings(preset) {
|
|
42
|
+
for (const name of Object.keys(kai_settings)) {
|
|
43
|
+
const value = preset[name];
|
|
44
|
+
const slider = sliders.find(x => x.name === name);
|
|
45
|
+
|
|
46
|
+
if (value === undefined || !slider) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const formattedValue = slider.format(value);
|
|
51
|
+
slider.setValue(preset[name]);
|
|
52
|
+
$(slider.sliderId).val(preset[name]);
|
|
53
|
+
$(slider.counterId).text(formattedValue);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// TODO: refactor checkboxes (if adding any more)
|
|
57
|
+
if (preset.hasOwnProperty('single_line')) {
|
|
58
|
+
kai_settings.single_line = preset.single_line;
|
|
59
|
+
$('#single_line').prop('checked', kai_settings.single_line);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function getKoboldGenerationData(finalPromt, this_settings, this_amount_gen, this_max_context, isImpersonate) {
|
|
64
|
+
let generate_data = {
|
|
65
|
+
prompt: finalPromt,
|
|
66
|
+
gui_settings: false,
|
|
67
|
+
sampler_order: this_settings.sampler_order,
|
|
68
|
+
max_context_length: parseInt(this_max_context),
|
|
69
|
+
max_length: this_amount_gen,
|
|
70
|
+
rep_pen: parseFloat(kai_settings.rep_pen),
|
|
71
|
+
rep_pen_range: parseInt(kai_settings.rep_pen_range),
|
|
72
|
+
rep_pen_slope: kai_settings.rep_pen_slope,
|
|
73
|
+
temperature: parseFloat(kai_settings.temp),
|
|
74
|
+
tfs: kai_settings.tfs,
|
|
75
|
+
top_a: kai_settings.top_a,
|
|
76
|
+
top_k: kai_settings.top_k,
|
|
77
|
+
top_p: kai_settings.top_p,
|
|
78
|
+
typical: kai_settings.typical,
|
|
79
|
+
s1: this_settings.sampler_order[0],
|
|
80
|
+
s2: this_settings.sampler_order[1],
|
|
81
|
+
s3: this_settings.sampler_order[2],
|
|
82
|
+
s4: this_settings.sampler_order[3],
|
|
83
|
+
s5: this_settings.sampler_order[4],
|
|
84
|
+
s6: this_settings.sampler_order[5],
|
|
85
|
+
s7: this_settings.sampler_order[6],
|
|
86
|
+
use_world_info: false,
|
|
87
|
+
singleline: kai_settings.single_line,
|
|
88
|
+
stop_sequence: kai_settings.use_stop_sequence ? getStoppingStrings(isImpersonate, false) : undefined,
|
|
89
|
+
};
|
|
90
|
+
return generate_data;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const sliders = [
|
|
94
|
+
{
|
|
95
|
+
name: "temp",
|
|
96
|
+
sliderId: "#temp",
|
|
97
|
+
counterId: "#temp_counter",
|
|
98
|
+
format: (val) => Number(val).toFixed(2),
|
|
99
|
+
setValue: (val) => { kai_settings.temp = Number(val); },
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "rep_pen",
|
|
103
|
+
sliderId: "#rep_pen",
|
|
104
|
+
counterId: "#rep_pen_counter",
|
|
105
|
+
format: (val) => Number(val).toFixed(2),
|
|
106
|
+
setValue: (val) => { kai_settings.rep_pen = Number(val); },
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "rep_pen_range",
|
|
110
|
+
sliderId: "#rep_pen_range",
|
|
111
|
+
counterId: "#rep_pen_range_counter",
|
|
112
|
+
format: (val) => val,
|
|
113
|
+
setValue: (val) => { kai_settings.rep_pen_range = Number(val); },
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "top_p",
|
|
117
|
+
sliderId: "#top_p",
|
|
118
|
+
counterId: "#top_p_counter",
|
|
119
|
+
format: (val) => val,
|
|
120
|
+
setValue: (val) => { kai_settings.top_p = Number(val); },
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "top_a",
|
|
124
|
+
sliderId: "#top_a",
|
|
125
|
+
counterId: "#top_a_counter",
|
|
126
|
+
format: (val) => val,
|
|
127
|
+
setValue: (val) => { kai_settings.top_a = Number(val); },
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "top_k",
|
|
131
|
+
sliderId: "#top_k",
|
|
132
|
+
counterId: "#top_k_counter",
|
|
133
|
+
format: (val) => val,
|
|
134
|
+
setValue: (val) => { kai_settings.top_k = Number(val); },
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "typical",
|
|
138
|
+
sliderId: "#typical",
|
|
139
|
+
counterId: "#typical_counter",
|
|
140
|
+
format: (val) => val,
|
|
141
|
+
setValue: (val) => { kai_settings.typical = Number(val); },
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "tfs",
|
|
145
|
+
sliderId: "#tfs",
|
|
146
|
+
counterId: "#tfs_counter",
|
|
147
|
+
format: (val) => val,
|
|
148
|
+
setValue: (val) => { kai_settings.tfs = Number(val); },
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "rep_pen_slope",
|
|
152
|
+
sliderId: "#rep_pen_slope",
|
|
153
|
+
counterId: "#rep_pen_slope_counter",
|
|
154
|
+
format: (val) => val,
|
|
155
|
+
setValue: (val) => { kai_settings.rep_pen_slope = Number(val); },
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
function canUseKoboldStopSequence(version) {
|
|
160
|
+
return (version || '0.0.0').localeCompare(MIN_STOP_SEQUENCE_VERSION, undefined, { numeric: true, sensitivity: 'base' }) > -1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
$(document).ready(function () {
|
|
164
|
+
sliders.forEach(slider => {
|
|
165
|
+
$(document).on("input", slider.sliderId, function () {
|
|
166
|
+
const value = $(this).val();
|
|
167
|
+
const formattedValue = slider.format(value);
|
|
168
|
+
slider.setValue(value);
|
|
169
|
+
$(slider.counterId).html(formattedValue);
|
|
170
|
+
saveSettingsDebounced();
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
$('#single_line').on("input", function () {
|
|
175
|
+
const value = $(this).prop('checked');
|
|
176
|
+
kai_settings.single_line = value;
|
|
177
|
+
saveSettingsDebounced();
|
|
178
|
+
});
|
|
179
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
saveSettingsDebounced,
|
|
3
|
+
} from "../script.js";
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
nai_settings,
|
|
7
|
+
loadNovelPreset,
|
|
8
|
+
loadNovelSettings,
|
|
9
|
+
getNovelTier,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const nai_settings = {
|
|
13
|
+
temp_novel: 0.5,
|
|
14
|
+
rep_pen_novel: 1,
|
|
15
|
+
rep_pen_size_novel: 100,
|
|
16
|
+
model_novel: "euterpe-v2",
|
|
17
|
+
api_key_novel: "",
|
|
18
|
+
preset_settings_novel: "Classic-Euterpe",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const nai_tiers = {
|
|
22
|
+
0: 'Paper',
|
|
23
|
+
1: 'Tablet',
|
|
24
|
+
2: 'Scroll',
|
|
25
|
+
3: 'Opus',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function getNovelTier(tier) {
|
|
29
|
+
return nai_tiers[tier] ?? 'no_connection';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function loadNovelPreset(preset) {
|
|
33
|
+
nai_settings.temp_novel = preset.temperature;
|
|
34
|
+
nai_settings.rep_pen_novel = preset.repetition_penalty;
|
|
35
|
+
nai_settings.rep_pen_size_novel = preset.repetition_penalty_range;
|
|
36
|
+
$("#temp_novel").val(nai_settings.temp_novel);
|
|
37
|
+
$("#temp_counter_novel").html(nai_settings.temp_novel);
|
|
38
|
+
|
|
39
|
+
$("#rep_pen_novel").val(nai_settings.rep_pen_novel);
|
|
40
|
+
$("#rep_pen_counter_novel").html(nai_settings.rep_pen_novel);
|
|
41
|
+
|
|
42
|
+
$("#rep_pen_size_novel").val(nai_settings.rep_pen_size_novel);
|
|
43
|
+
$("#rep_pen_size_counter_novel").html(`${nai_settings.rep_pen_size_novel}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function loadNovelSettings(settings) {
|
|
47
|
+
//load Novel API KEY is exists
|
|
48
|
+
if (settings.api_key_novel != undefined) {
|
|
49
|
+
nai_settings.api_key_novel = settings.api_key_novel;
|
|
50
|
+
$("#api_key_novel").val(nai_settings.api_key_novel);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//load the rest of the Novel settings without any checks
|
|
54
|
+
nai_settings.model_novel = settings.model_novel;
|
|
55
|
+
$(`#model_novel_select option[value=${nai_settings.model_novel}]`).attr("selected", true);
|
|
56
|
+
|
|
57
|
+
nai_settings.temp_novel = settings.temp_novel;
|
|
58
|
+
nai_settings.rep_pen_novel = settings.rep_pen_novel;
|
|
59
|
+
nai_settings.rep_pen_size_novel = settings.rep_pen_size_novel;
|
|
60
|
+
|
|
61
|
+
$("#temp_novel").val(nai_settings.temp_novel);
|
|
62
|
+
$("#temp_counter_novel").text(Number(nai_settings.temp_novel).toFixed(2));
|
|
63
|
+
|
|
64
|
+
$("#rep_pen_novel").val(nai_settings.rep_pen_novel);
|
|
65
|
+
$("#rep_pen_counter_novel").text(Number(nai_settings.rep_pen_novel).toFixed(2));
|
|
66
|
+
|
|
67
|
+
$("#rep_pen_size_novel").val(nai_settings.rep_pen_size_novel);
|
|
68
|
+
$("#rep_pen_size_counter_novel").text(`${nai_settings.rep_pen_size_novel}`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const sliders = [
|
|
72
|
+
{
|
|
73
|
+
sliderId: "#temp_novel",
|
|
74
|
+
counterId: "#temp_counter_novel",
|
|
75
|
+
format: (val) => Number(val).toFixed(2),
|
|
76
|
+
setValue: (val) => { nai_settings.temp_novel = Number(val); },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
sliderId: "#rep_pen_novel",
|
|
80
|
+
counterId: "#rep_pen_counter_novel",
|
|
81
|
+
format: (val) => Number(val).toFixed(2),
|
|
82
|
+
setValue: (val) => { nai_settings.rep_pen_novel = Number(val); },
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
sliderId: "#rep_pen_size_novel",
|
|
86
|
+
counterId: "#rep_pen_size_counter_novel",
|
|
87
|
+
format: (val) => `${val}`,
|
|
88
|
+
setValue: (val) => { nai_settings.rep_pen_size_novel = Number(val); },
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
$(document).ready(function () {
|
|
93
|
+
sliders.forEach(slider => {
|
|
94
|
+
$(document).on("input", slider.sliderId, function () {
|
|
95
|
+
const value = $(this).val();
|
|
96
|
+
const formattedValue = slider.format(value);
|
|
97
|
+
slider.setValue(value);
|
|
98
|
+
$(slider.counterId).html(formattedValue);
|
|
99
|
+
console.log('saving');
|
|
100
|
+
saveSettingsDebounced();
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
$("#model_novel_select").change(function () {
|
|
105
|
+
nai_settings.model_novel = $("#model_novel_select").find(":selected").val();
|
|
106
|
+
saveSettingsDebounced();
|
|
107
|
+
});
|
|
108
|
+
});
|