Repository navigation
MOSS: line breaks, negative prompt and an opt-in layout; fix VIP junk slots - #267
Merged
Merged
Conversation
… slots
Line breaks: every slot keeps the user's line breaks inside the quoted
text, written as \n in the JSON string; a literal backslash-n from a
model that escapes twice becomes a line break.
Negative prompt: a call with a MOSS-Image slot also returns
slot_moss_negative, up to three short phrases the request rules out
("без шапки" gives "hat", the text after `|`). The bot sends it, or the
typed negative of a verbatim !draw, to the moss_generate endpoint only;
draw-api appends its general negative.
Layout: with "prompt_layout": true in the MOSS model config, the optimizer
also writes slot_moss_design and slot_moss_layout (official summary plus
flat items, yxyx boxes on a 0-1000 grid) and the bot sends the layout of a
designed picture to moss_generate. Off by default: in an A/B at
production settings (12 requests, 2 seeds) the prose route drew all text
correctly and the layout route did not.
VIP junk slots: the optimizer schema serializes its keys alphabetically,
so the grammar-constrained model writes aspect_ratio, input, nsfw_result,
outputs. The examples were written input, outputs, nsfw_result,
aspect_ratio; after the first prompt they promised nsfw_result, and in
the three-slot VIP call the model wrote a field name such as
"nsfw_result_slot_0_1_2" as the next prompt or looped in it to the token
limit (44 % of answers on production Gemma). The examples now follow the
grammar's order, the slot rules say every element is a full prompt, and a
placeholder output is replaced by the nearest real prompt: 0 of 24 bad
answers. A test keeps the examples in the schema's key order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\n; a literal backslash-n (double escaping) is normalized to a line break.slot_moss_negative(up to three phrases the request excludes, e.g. "без шапки" →hat, text after|). The bot sends it — or the typed negative of a verbatim!draw— tomoss_generateonly; draw-api appends its general negative (iamwavecut/aifarm-draw#37)."prompt_layout": truein the MOSS model config addsslot_moss_design+slot_moss_layout(officialsummary+ flatitems,yxyxon a 0-1000 grid) to the prompt and schema, and the bot sends a designed picture's layout tomoss_generate. Default off: in the A/B the prose route drew all text correctly, the layout route did not.aspect_ratio, input, nsfw_result, outputs; the examples were in another order. In the three-slot VIP call the model then wrote a field name such asnsfw_result_slot_0_1_2as a prompt or looped until the token limit. Examples now follow the grammar order, the slot rules say every element is a full prompt, andreplace_placeholder_outputsswaps a placeholder for the nearest real prompt.Evidence
hat,people,people, boats,people, plants, empty otherwise). User line breaks reached all three slots in 2/2 requests.Tests
cargo test --locked --workspace,cargo clippy --locked --workspace --all-targets --all-features -- -D warnings,cargo fmt --all -- --check: pass.slot_moss_negativeonly / with layout),prompt_layoutfrom the routed model config, layout and negative reach only the MOSS endpoint and stay with their slot, placeholder replacement, forbidden requests drop the MOSS fields, word replacements reach layout captions but not lettering, andexamples_write_their_keys_in_the_order_the_grammar_does.