Skip to content

Commit

Permalink
Merge pull request #24 from Fensterbank/repetition-whitelist
Browse files Browse the repository at this point in the history
flatten repetition_penalty_whitelist
  • Loading branch information
Aedial committed Nov 26, 2023
2 parents dbb3507 + 2ad60d9 commit 37f2250
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions novelai_api/_high_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,12 @@ async def _generate(
global_settings.rep_pen_whitelist = repetition_penalty_default_whitelist

params = {
"repetition_penalty_whitelist": [
*global_params.pop("repetition_penalty_whitelist", []),
*preset_params.pop("repetition_penalty_whitelist", []),
]
"repetition_penalty_whitelist": list(set(
item for sublist in [
global_params.pop("repetition_penalty_whitelist", []),
preset_params.pop("repetition_penalty_whitelist", []),
] for inner_list in sublist for item in inner_list
))
}

params.update(preset_params)
Expand Down

0 comments on commit 37f2250

Please sign in to comment.