gradio server

#2
by akhaliq HF Staff - opened

use gradio server for custom frontend with gradio backend see: https://huggingface.co/blog/introducing-gradio-server

akhaliq changed pull request status to open
Simonlob changed pull request status to merged
NineNineSix org

merge

NineNineSix org

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.

Sign up or log in to comment