Spaces:
Running on Zero
gradio server
use gradio server for custom frontend with gradio backend see: https://huggingface.co/blog/introducing-gradio-server
merge
Looks fire! But there's one bug I missed at first, and cause of it inference worked terrible - model just fell apart on some sentences. Took me a while but found it - the trick is in the html. New UI grabs text from contenteditable via innerText, and it drags a lot of hidden junk into the model - newlines, non-breaking spaces, zero-width chars, sometimes even html from paste. Old Textbox never did that. So text has to be normalized before it hits the model. I did it in engine.py right before generate, not in js - synthesize is a public api (gradio_client and stuff), so cleaning only in browser is not enough, everything should go through one place. Just strip tags, drop the invisible chars, collapse whitespace. Case and punctuation keep as is.