diff --git a/.buildinfo b/.buildinfo index acd8df7..ef1fd06 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: c93789845a029e5456f719afec083d67 +config: 48465817e8889750dfdc44ef138c3716 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/_modules/example/boilerplate.html b/_modules/example/boilerplate.html index 401c883..ca7bfe8 100644 --- a/_modules/example/boilerplate.html +++ b/_modules/example/boilerplate.html @@ -5,7 +5,7 @@
-
[34650],
]
+ # whitelist
+ _REP_PEN_WHITELIST = {
+ "gpt2": [],
+ "gpt2-genji": [],
+ "pile": [],
+ "nerdstash_v1": [
+ "'",
+ '"',
+ ",",
+ ":",
+ "\n",
+ "ve",
+ "s",
+ "t",
+ "n",
+ "d",
+ "ll",
+ "re",
+ "m",
+ "-",
+ "*",
+ ")",
+ " the",
+ " a",
+ " an",
+ " and",
+ " or",
+ " not",
+ " no",
+ " is",
+ " was",
+ " were",
+ " did",
+ " does",
+ " isn",
+ " wasn",
+ " weren",
+ " didn",
+ " doesn",
+ " him",
+ " her",
+ " his",
+ " hers",
+ " their",
+ " its",
+ " could",
+ " couldn",
+ " should",
+ " shouldn",
+ " would",
+ " wouldn",
+ " have",
+ " haven",
+ " had",
+ " hadn",
+ " has",
+ " hasn",
+ " can",
+ " cannot",
+ " are",
+ " aren",
+ " will",
+ " won",
+ "0",
+ "1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ '."',
+ ',"',
+ "====",
+ " ",
+ ],
+ }
+
_DINKUS_ASTERISM = BiasGroup(-0.12).add("***", "⁂")
_DEFAULT_SETTINGS = {
@@ -672,6 +752,7 @@ Source code for novelai_api.GlobalSettings
"ban_brackets": True,
"bias_dinkus_asterism": False,
"ban_ambiguous_genji_tokens": True,
+ "rep_pen_whitelist": True,
}
# type completion for __setitem__ and __getitem__
@@ -686,6 +767,8 @@ Source code for novelai_api.GlobalSettings
bias_dinkus_asterism: bool
#: Apply the GENJI_AMBIGUOUS_TOKENS if model is Genji
ban_ambiguous_genji_tokens: bool
+ #: Apply the REP_PEN_WHITELIST (repetition penalty whitelist)
+ rep_pen_whitelist: bool
#: Value to set num_logprobs at to disable logprobs
NO_LOGPROBS = -1
@@ -746,6 +829,7 @@ Source code for novelai_api.GlobalSettings
"num_logprobs": self._settings["num_logprobs"],
"bad_words_ids": [],
"logit_bias_exp": [],
+ "repetition_penalty_whitelist": [],
"return_full_text": False,
"use_string": False,
"use_cache": False,
@@ -766,6 +850,11 @@ Source code for novelai_api.GlobalSettings
if self._settings["bias_dinkus_asterism"]:
settings["logit_bias_exp"].extend(self._DINKUS_ASTERISM.get_tokenized_entries(model))
+ if self._settings["rep_pen_whitelist"]:
+ settings["repetition_penalty_whitelist"].extend(
+ Tokenizer.encode(model, tok) for tok in self._REP_PEN_WHITELIST[tokenizer_name]
+ )
+
return settings
@@ -798,7 +887,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.GlobalSettings
diff --git a/_modules/novelai_api/Idstore.html b/_modules/novelai_api/Idstore.html
index 8011760..f40d441 100644
--- a/_modules/novelai_api/Idstore.html
+++ b/_modules/novelai_api/Idstore.html
@@ -5,7 +5,7 @@
- novelai_api.Idstore — NovelAI API 0.16.3 documentation
+ novelai_api.Idstore — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.Idstore
@@ -126,7 +126,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.Idstore
diff --git a/_modules/novelai_api/ImagePreset.html b/_modules/novelai_api/ImagePreset.html
index b5bb672..7b3008b 100644
--- a/_modules/novelai_api/ImagePreset.html
+++ b/_modules/novelai_api/ImagePreset.html
@@ -5,7 +5,7 @@
- novelai_api.ImagePreset — NovelAI API 0.16.3 documentation
+ novelai_api.ImagePreset — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.ImagePreset
@@ -87,9 +87,9 @@ Source code for novelai_api.ImagePreset
Palette_Swap = "hed"
Form_Lock = "midas"
- Scrible = "fake_scribble"
+ Scribbler = "fake_scribble"
Building_Control = "mlsd"
- Lanscaper = "uniformer"
+ Landscaper = "uniformer"
[docs]class ImageResolution(enum.Enum):
@@ -193,9 +193,9 @@ Source code for novelai_api.ImagePreset
_CONTROLNET_MODELS = {
ControlNetModel.Palette_Swap: "hed",
ControlNetModel.Form_Lock: "depth",
- ControlNetModel.Scrible: "scribble",
+ ControlNetModel.Scribbler: "scribble",
ControlNetModel.Building_Control: "mlsd",
- ControlNetModel.Lanscaper: "seg",
+ ControlNetModel.Landscaper: "seg",
}
_TYPE_MAPPING = {
@@ -511,7 +511,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.ImagePreset
diff --git a/_modules/novelai_api/Keystore.html b/_modules/novelai_api/Keystore.html
index 3116d6c..735ad45 100644
--- a/_modules/novelai_api/Keystore.html
+++ b/_modules/novelai_api/Keystore.html
@@ -5,7 +5,7 @@
- novelai_api.Keystore — NovelAI API 0.16.3 documentation
+ novelai_api.Keystore — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.Keystore
@@ -260,7 +260,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.Keystore
diff --git a/_modules/novelai_api/NovelAIError.html b/_modules/novelai_api/NovelAIError.html
index 5e702c2..b6122af 100644
--- a/_modules/novelai_api/NovelAIError.html
+++ b/_modules/novelai_api/NovelAIError.html
@@ -5,7 +5,7 @@
- novelai_api.NovelAIError — NovelAI API 0.16.3 documentation
+ novelai_api.NovelAIError — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.NovelAIError
@@ -105,7 +105,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.NovelAIError
diff --git a/_modules/novelai_api/NovelAI_API.html b/_modules/novelai_api/NovelAI_API.html
index 5d08a9b..a561c3a 100644
--- a/_modules/novelai_api/NovelAI_API.html
+++ b/_modules/novelai_api/NovelAI_API.html
@@ -5,7 +5,7 @@
- novelai_api.NovelAI_API — NovelAI API 0.16.3 documentation
+ novelai_api.NovelAI_API — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.NovelAI_API
@@ -194,7 +194,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.NovelAI_API
diff --git a/_modules/novelai_api/Preset.html b/_modules/novelai_api/Preset.html
index b5dca9e..05552c3 100644
--- a/_modules/novelai_api/Preset.html
+++ b/_modules/novelai_api/Preset.html
@@ -5,7 +5,7 @@
- novelai_api.Preset — NovelAI API 0.16.3 documentation
+ novelai_api.Preset — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.Preset
@@ -646,7 +646,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.Preset
diff --git a/_modules/novelai_api/SchemaValidator.html b/_modules/novelai_api/SchemaValidator.html
index 44b3c86..f7b4e40 100644
--- a/_modules/novelai_api/SchemaValidator.html
+++ b/_modules/novelai_api/SchemaValidator.html
@@ -5,7 +5,7 @@
- novelai_api.SchemaValidator — NovelAI API 0.16.3 documentation
+ novelai_api.SchemaValidator — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.SchemaValidator
@@ -121,7 +121,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.SchemaValidator
diff --git a/_modules/novelai_api/StoryHandler.html b/_modules/novelai_api/StoryHandler.html
index 91aee05..023987a 100644
--- a/_modules/novelai_api/StoryHandler.html
+++ b/_modules/novelai_api/StoryHandler.html
@@ -5,7 +5,7 @@
- novelai_api.StoryHandler — NovelAI API 0.16.3 documentation
+ novelai_api.StoryHandler — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.StoryHandler
@@ -551,7 +551,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.StoryHandler
diff --git a/_modules/novelai_api/Tokenizer.html b/_modules/novelai_api/Tokenizer.html
index 475adce..9226472 100644
--- a/_modules/novelai_api/Tokenizer.html
+++ b/_modules/novelai_api/Tokenizer.html
@@ -5,7 +5,7 @@
- novelai_api.Tokenizer — NovelAI API 0.16.3 documentation
+ novelai_api.Tokenizer — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.Tokenizer
@@ -297,7 +297,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.Tokenizer
diff --git a/_modules/novelai_api/_high_level.html b/_modules/novelai_api/_high_level.html
index bca35dd..36a0d05 100644
--- a/_modules/novelai_api/_high_level.html
+++ b/_modules/novelai_api/_high_level.html
@@ -5,7 +5,7 @@
- novelai_api._high_level — NovelAI API 0.16.3 documentation
+ novelai_api._high_level — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api._high_level
@@ -337,6 +337,10 @@ Source code for novelai_api._high_level
params = {}
+ # merge rep pen whitelist if both are set
+ if "repetition_penalty_whitelist" in preset_params and "repetition_penalty_whitelist" in global_params:
+ preset_params["repetition_penalty_whitelist"] += global_params.pop("repetition_penalty_whitelist")
+
params.update(preset_params)
params.update(global_params)
params.update(kwargs)
@@ -522,7 +526,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api._high_level
diff --git a/_modules/novelai_api/_low_level.html b/_modules/novelai_api/_low_level.html
index 9187d1f..96ddf43 100644
--- a/_modules/novelai_api/_low_level.html
+++ b/_modules/novelai_api/_low_level.html
@@ -5,7 +5,7 @@
- novelai_api._low_level — NovelAI API 0.16.3 documentation
+ novelai_api._low_level — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api._low_level
@@ -595,7 +595,7 @@ Source code for novelai_api._low_level
self._treat_response_object(rsp, content, 200)
if self.is_schema_validation_enabled:
- SchemaValidator.validate("schema_userData", content)
+ SchemaValidator.validate("schema_UserData", content)
return content
@@ -995,7 +995,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api._low_level
diff --git a/_modules/novelai_api/utils.html b/_modules/novelai_api/utils.html
index ccfce64..c279d28 100644
--- a/_modules/novelai_api/utils.html
+++ b/_modules/novelai_api/utils.html
@@ -5,7 +5,7 @@
- novelai_api.utils — NovelAI API 0.16.3 documentation
+ novelai_api.utils — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.utils
@@ -456,7 +456,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
novelai_api.utils
diff --git a/_modules/tests/api/boilerplate.html b/_modules/tests/api/boilerplate.html
index e5e55af..570f54a 100644
--- a/_modules/tests/api/boilerplate.html
+++ b/_modules/tests/api/boilerplate.html
@@ -5,7 +5,7 @@
- tests.api.boilerplate — NovelAI API 0.16.3 documentation
+ tests.api.boilerplate — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
tests.api.boilerplate
@@ -251,7 +251,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
tests.api.boilerplate
diff --git a/_modules/tests/api/test_decrypt_encrypt_integrity_check.html b/_modules/tests/api/test_decrypt_encrypt_integrity_check.html
index 7ff4b2e..92e1c6e 100644
--- a/_modules/tests/api/test_decrypt_encrypt_integrity_check.html
+++ b/_modules/tests/api/test_decrypt_encrypt_integrity_check.html
@@ -5,7 +5,7 @@
- tests.api.test_decrypt_encrypt_integrity_check — NovelAI API 0.16.3 documentation
+ tests.api.test_decrypt_encrypt_integrity_check — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
tests.api.test_decrypt_encrypt_integrity_check
@@ -307,7 +307,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
tests.api.test_decrypt_encrypt_integrity_check
diff --git a/_modules/tests/api/test_textgen_presets.html b/_modules/tests/api/test_textgen_presets.html
index ecdb93a..61b5a4a 100644
--- a/_modules/tests/api/test_textgen_presets.html
+++ b/_modules/tests/api/test_textgen_presets.html
@@ -5,7 +5,7 @@
- tests.api.test_textgen_presets — NovelAI API 0.16.3 documentation
+ tests.api.test_textgen_presets — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
tests.api.test_textgen_presets
@@ -144,7 +144,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Module code »
tests.api.test_textgen_presets
diff --git a/_static/documentation_options.js b/_static/documentation_options.js
index b038a5c..4169bb2 100644
--- a/_static/documentation_options.js
+++ b/_static/documentation_options.js
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
- VERSION: '0.16.3',
+ VERSION: '0.17.0',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
diff --git a/example/example.boilerplate.html b/example/example.boilerplate.html
index b07461c..5c4065e 100644
--- a/example/example.boilerplate.html
+++ b/example/example.boilerplate.html
@@ -6,7 +6,7 @@
- boilerplate — NovelAI API 0.16.3 documentation
+ boilerplate — NovelAI API 0.17.0 documentation
@@ -52,7 +52,7 @@ Navigation
previous |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
example directory »
boilerplate
@@ -198,7 +198,7 @@ Navigation
previous |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
example directory »
boilerplate
diff --git a/example/example.html b/example/example.html
index 60c9535..d95792b 100644
--- a/example/example.html
+++ b/example/example.html
@@ -6,7 +6,7 @@
- example directory — NovelAI API 0.16.3 documentation
+ example directory — NovelAI API 0.17.0 documentation
@@ -52,7 +52,7 @@ Navigation
previous |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
example directory
@@ -284,7 +284,7 @@ Navigation
previous |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
example directory
diff --git a/genindex.html b/genindex.html
index 431afac..4d2cc46 100644
--- a/genindex.html
+++ b/genindex.html
@@ -5,7 +5,7 @@
- Index — NovelAI API 0.16.3 documentation
+ Index — NovelAI API 0.17.0 documentation
@@ -43,7 +43,7 @@ Navigation
modules |
- NovelAI API 0.16.3 documentation »
+ NovelAI API 0.17.0 documentation »
Index
@@ -711,7 +711,7 @@ K
L
Apply the GENJI_AMBIGUOUS_TOKENS if model is Genji
Apply the REP_PEN_WHITELIST (repetition penalty whitelist)
+GlobalSettings.ban_brackets
GlobalSettings.bias_dinkus_asterism
GlobalSettings.ban_ambiguous_genji_tokens
GlobalSettings.rep_pen_whitelist
GlobalSettings.NO_LOGPROBS
GlobalSettings.__init__()
GlobalSettings.copy()
ControlNetModel
ImageResolution