fish-speech icon indicating copy to clipboard operation
fish-speech copied to clipboard

[Feature] WebUI improvement: handling empty input boxes

Open puff-dayo opened this issue 2 years ago • 1 comments

In the current version (v1.0.0), if some input boxes are left empty, WebUI will still send the inference command to the backend, causing a RuntimeError: torch.cat(): expected a non-empty list of Tensors error, while the WebUI simply displays an default "Error" text.

To improve user experience, I suggest adding a validation function to handle empty input boxes. This would display a friendlier error message in the WebUI. Just an example:

def validate_input(text: str) -> bool:
    if not text:
        raise gr.Error("Please ensure that <InputBox1>  is not left empty.")
    return True

( •̀ ω •́ )✧

puff-dayo avatar May 07 '24 18:05 puff-dayo

Sounds good, fixed.

leng-yue avatar May 08 '24 10:05 leng-yue