From b3c4657c476310b98b0a006002924da44e8141f0 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 11 Feb 2023 14:54:29 -0300 Subject: [PATCH] Remove commas from preset files --- presets/Debug-deterministic.txt | 2 +- presets/Default.txt | 6 +++--- presets/Individual Today.txt | 12 ++++++------ presets/Instruct-Joi.txt | 10 +++++----- presets/Kobold-Godlike.txt | 12 ++++++------ presets/Kobold-Liminal Drift.txt | 12 ++++++------ presets/Naive.txt | 8 ++++---- presets/NovelAI-Best Guess.txt | 12 ++++++------ presets/NovelAI-Decadence.txt | 12 ++++++------ presets/NovelAI-Genesis.txt | 12 ++++++------ presets/NovelAI-Lycaenidae.txt | 12 ++++++------ presets/NovelAI-Ouroboros.txt | 12 ++++++------ presets/NovelAI-Pleasing Results.txt | 12 ++++++------ presets/NovelAI-Sphinx Moth.txt | 12 ++++++------ presets/NovelAI-Storywriter.txt | 12 ++++++------ presets/Pygmalion.txt | 12 ++++++------ presets/Verbose.txt | 18 +++++++++--------- server.py | 4 ++-- 18 files changed, 96 insertions(+), 96 deletions(-) diff --git a/presets/Debug-deterministic.txt b/presets/Debug-deterministic.txt index efa2c339..6673b71c 100644 --- a/presets/Debug-deterministic.txt +++ b/presets/Debug-deterministic.txt @@ -1 +1 @@ -do_sample=False, +do_sample=False diff --git a/presets/Default.txt b/presets/Default.txt index 026cad3e..5b970dc6 100644 --- a/presets/Default.txt +++ b/presets/Default.txt @@ -1,3 +1,3 @@ -do_sample=True, -top_k=100, -top_p=0.9, +do_sample=True +top_k=100 +top_p=0.9 diff --git a/presets/Individual Today.txt b/presets/Individual Today.txt index 3cac3fcd..f40b879c 100644 --- a/presets/Individual Today.txt +++ b/presets/Individual Today.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=0.9, -top_k=50, -temperature=1.39, -repetition_penalty=1.08, -typical_p=0.2, +do_sample=True +top_p=0.9 +top_k=50 +temperature=1.39 +repetition_penalty=1.08 +typical_p=0.2 diff --git a/presets/Instruct-Joi.txt b/presets/Instruct-Joi.txt index cc21ba11..e17f0a66 100644 --- a/presets/Instruct-Joi.txt +++ b/presets/Instruct-Joi.txt @@ -1,5 +1,5 @@ -top_p=0.95, -temperature=0.5, -penalty_alpha=0.6, -top_k=4, -repetition_penalty=1.03, +top_p=0.95 +temperature=0.5 +penalty_alpha=0.6 +top_k=4 +repetition_penalty=1.03 diff --git a/presets/Kobold-Godlike.txt b/presets/Kobold-Godlike.txt index 091634d1..0ba5b794 100644 --- a/presets/Kobold-Godlike.txt +++ b/presets/Kobold-Godlike.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=0.5, -top_k=0, -temperature=0.7, -repetition_penalty=1.1, -typical_p=0.19, +do_sample=True +top_p=0.5 +top_k=0 +temperature=0.7 +repetition_penalty=1.1 +typical_p=0.19 diff --git a/presets/Kobold-Liminal Drift.txt b/presets/Kobold-Liminal Drift.txt index 6d594d7c..be4dd3bd 100644 --- a/presets/Kobold-Liminal Drift.txt +++ b/presets/Kobold-Liminal Drift.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=1.0, -top_k=0, -temperature=0.66, -repetition_penalty=1.1, -typical_p=0.6, +do_sample=True +top_p=1.0 +top_k=0 +temperature=0.66 +repetition_penalty=1.1 +typical_p=0.6 diff --git a/presets/Naive.txt b/presets/Naive.txt index 34eb0b24..b2323987 100644 --- a/presets/Naive.txt +++ b/presets/Naive.txt @@ -1,4 +1,4 @@ -do_sample=True, -top_p=1, -typical_p=0.3, -temperature=0.7, +do_sample=True +top_p=1 +typical_p=0.3 +temperature=0.7 diff --git a/presets/NovelAI-Best Guess.txt b/presets/NovelAI-Best Guess.txt index 3f4b7e1f..db3fa75b 100644 --- a/presets/NovelAI-Best Guess.txt +++ b/presets/NovelAI-Best Guess.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=0.9, -top_k=100, -temperature=0.8, -repetition_penalty=1.15, -typical_p=1.0, +do_sample=True +top_p=0.9 +top_k=100 +temperature=0.8 +repetition_penalty=1.15 +typical_p=1.0 diff --git a/presets/NovelAI-Decadence.txt b/presets/NovelAI-Decadence.txt index 1c0d2b18..d3109f3e 100644 --- a/presets/NovelAI-Decadence.txt +++ b/presets/NovelAI-Decadence.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=1.0, -top_k=100, -temperature=2, -repetition_penalty=1, -typical_p=0.97, +do_sample=True +top_p=1.0 +top_k=100 +temperature=2 +repetition_penalty=1 +typical_p=0.97 diff --git a/presets/NovelAI-Genesis.txt b/presets/NovelAI-Genesis.txt index 91b4c36d..cc7376b3 100644 --- a/presets/NovelAI-Genesis.txt +++ b/presets/NovelAI-Genesis.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=0.98, -top_k=0, -temperature=0.63, -repetition_penalty=1.05, -typical_p=1.0, +do_sample=True +top_p=0.98 +top_k=0 +temperature=0.63 +repetition_penalty=1.05 +typical_p=1.0 diff --git a/presets/NovelAI-Lycaenidae.txt b/presets/NovelAI-Lycaenidae.txt index 96cf0327..0134569c 100644 --- a/presets/NovelAI-Lycaenidae.txt +++ b/presets/NovelAI-Lycaenidae.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=0.85, -top_k=12, -temperature=2, -repetition_penalty=1.15, -typical_p=1.0, +do_sample=True +top_p=0.85 +top_k=12 +temperature=2 +repetition_penalty=1.15 +typical_p=1.0 diff --git a/presets/NovelAI-Ouroboros.txt b/presets/NovelAI-Ouroboros.txt index 62b13215..1e944b54 100644 --- a/presets/NovelAI-Ouroboros.txt +++ b/presets/NovelAI-Ouroboros.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=1.0, -top_k=100, -temperature=1.07, -repetition_penalty=1.05, -typical_p=1.0, +do_sample=True +top_p=1.0 +top_k=100 +temperature=1.07 +repetition_penalty=1.05 +typical_p=1.0 diff --git a/presets/NovelAI-Pleasing Results.txt b/presets/NovelAI-Pleasing Results.txt index 9d44d7a7..330114a2 100644 --- a/presets/NovelAI-Pleasing Results.txt +++ b/presets/NovelAI-Pleasing Results.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=1.0, -top_k=0, -temperature=0.44, -repetition_penalty=1.15, -typical_p=1.0, +do_sample=True +top_p=1.0 +top_k=0 +temperature=0.44 +repetition_penalty=1.15 +typical_p=1.0 diff --git a/presets/NovelAI-Sphinx Moth.txt b/presets/NovelAI-Sphinx Moth.txt index 5ec1d5eb..bace1e24 100644 --- a/presets/NovelAI-Sphinx Moth.txt +++ b/presets/NovelAI-Sphinx Moth.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=0.18, -top_k=30, -temperature=2.0, -repetition_penalty=1.15, -typical_p=1.0, +do_sample=True +top_p=0.18 +top_k=30 +temperature=2.0 +repetition_penalty=1.15 +typical_p=1.0 diff --git a/presets/NovelAI-Storywriter.txt b/presets/NovelAI-Storywriter.txt index d8d2f3b9..2df5f818 100644 --- a/presets/NovelAI-Storywriter.txt +++ b/presets/NovelAI-Storywriter.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=0.73, -top_k=0, -temperature=0.72, -repetition_penalty=1.1, -typical_p=1.0, +do_sample=True +top_p=0.73 +top_k=0 +temperature=0.72 +repetition_penalty=1.1 +typical_p=1.0 diff --git a/presets/Pygmalion.txt b/presets/Pygmalion.txt index e9842be6..78995ec3 100644 --- a/presets/Pygmalion.txt +++ b/presets/Pygmalion.txt @@ -1,6 +1,6 @@ -do_sample=True, -top_p=0.9, -top_k=0, -temperature=0.5, -repetition_penalty=1.05, -typical_p=1.0, +do_sample=True +top_p=0.9 +top_k=0 +temperature=0.5 +repetition_penalty=1.05 +typical_p=1.0 diff --git a/presets/Verbose.txt b/presets/Verbose.txt index 9276594e..a3be1b94 100644 --- a/presets/Verbose.txt +++ b/presets/Verbose.txt @@ -1,9 +1,9 @@ -num_beams=10, -min_length=200, -length_penalty =1.4, -no_repeat_ngram_size=2, -early_stopping=True, -temperature=0.7, -top_k=150, -top_p=0.92, -repetition_penalty=4.5, +num_beams=10 +min_length=200 +length_penalty =1.4 +no_repeat_ngram_size=2 +early_stopping=True +temperature=0.7 +top_k=150 +top_p=0.92 +repetition_penalty=4.5 diff --git a/server.py b/server.py index 20cd3572..f7391487 100644 --- a/server.py +++ b/server.py @@ -182,8 +182,8 @@ def load_preset_values(preset_menu, return_dict=False): } with open(Path(f'presets/{preset_menu}.txt'), 'r') as infile: preset = infile.read() - for i in preset.split(','): - i = i.strip().split('=') + for i in preset.splitlines(): + i = i.rstrip(',').strip().split('=') if len(i) == 2 and i[0].strip() != 'tokens': generate_params[i[0].strip()] = eval(i[1].strip())