Aedial / novelai-api

Python API for the NovelAI REST API
https://aedial.github.io/novelai-api/
MIT License
129 stars 17 forks source link

flatten repetition_penalty_whitelist #24

Closed Fensterbank closed 10 months ago

Fensterbank commented 10 months ago

I noticed the repetition_penalty_whitelist is sent to the API as array of arrays while the web ui is sending a flat array of numbers. Therefore I don't know, if the way we are sending it now is even used by the API.

I'm not sure if my approach is good (I'm not a python developer), but it works.

Feel free to give hints on how better send the list as flat int array.

Aedial commented 10 months ago

It seems I indeed forgot to flatten the list. Side effect of using the tokenizer instead of token indexes directly. Code seems fine, might have starred the lists for one less loop, but it's a minor detail.