Comments (3)
Thanks for the answer! My problem is solved, I double checked the "preset" parameter in the api and the parameter in the web request and found the difference between them. Finally I found that it was the "repetition_penalty" that was affecting the output. I used to think it had no effect. When I set the "repetition_penalty" from the default "2.25" to "1.148125", the output text starts with The output text ends with a complete sentence.
Translated with www.DeepL.com/Translator (free version)
It seems there is an obscure scaling done on repetition penalty, adjusting the value following 0.525*(X - 1)/7 + 1 (with X previous rep pen - formula extracted from minified JavaScript code). Seems kind of weird for it to exist frontend-side and not backend-side.
A fix is coming along with new sanity tests checking compliancy instead of just "nothing is broken".
from novelai-api.
I see no bug here. Setting the generate_until_sentence to True does reflect on the request sent to the server when fed to the high_level.generate or high_level.generate_stream.
Note that it will continue sentence only if a period is actually found in the 20 tokens after the end. It means it is affected by context, preset, biases, bans, etc.
If you see an issue, it is likely incomplete copy of the settings on your side. For a deterministic comparison, set the top_k to 1 on both, and you should see the exact same content if both settings are the same.
from novelai-api.
I see no bug here. Setting the generate_until_sentence to True does reflect on the request sent to the server when fed to the high_level.generate or high_level.generate_stream. Note that it will continue sentence only if a period is actually found in the 20 tokens after the end. It means it is affected by context, preset, biases, bans, etc. If you see an issue, it is likely incomplete copy of the settings on your side. For a deterministic comparison, set the top_k to 1 on both, and you should see the exact same content if both settings are the same.
Thanks for the answer! My problem is solved, I double checked the "preset" parameter in the api and the parameter in the web request and found the difference between them. Finally I found that it was the "repetition_penalty" that was affecting the output. I used to think it had no effect. When I set the "repetition_penalty" from the default "2.25" to "1.148125", the output text starts with The output text ends with a complete sentence.
Translated with www.DeepL.com/Translator (free version)
from novelai-api.
Related Issues (20)
- Add support for 3.11
- generate_image return "novelai_api.NovelAIError.NovelAIError: 200 - OK" HOT 8
- Undesired content no longer set properly on image generation HOT 3
- Different results with /ai/annotate-image (controlnet mask generation) HOT 1
- Got the UnicodeDecodeError: 'utf-8' with /ai/generate-image HOT 1
- How to configure loreBook? HOT 2
- Noise for img2img doesn't work as expected
- Some questions I had: HOT 9
- Presets props are sent to the API, which are not sent by the official UI. HOT 5
- ddim sampler using /ai/generation-image API not working properly on nai-diffusion-v3. HOT 3
- What's the format for inpainting masks? HOT 4
- can not use email and password to login
- Dependency package `sentencepiece (==0.1.99)` dont support `python==3.12` HOT 1
- random tags HOT 7
- Needs ability to decode "document" field in StoryContent HOT 1
- default.preset does not apply. HOT 4
- They have two different base64 HOT 1
- Please add proxy setting to connect api HOT 3
- Could not work well in text Adventure HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from novelai-api.