Getting lots of "Connection errored out" lately
Hello.I’ve been getting a bunch of these lately on a couple of my spaces (last 3 days):Screen Shot 2023-01-26 at 11.54.22 AM848×310 36.9 KBDoesn’t happen when run locally. Not sure if they are related to caching the examples… or the queue… but I tried changing some of the queue settings and it didn’t seem to make a difference.Is there a way to disable the queue completely ?Space is here:huggingface.coMaskformer COCO Vegetation - a Hugging Face Space by thiagohersanDiscover amazing ML apps made by the community
2023-01-26T17:20:16Z
Hi@thiagohersan,Can you track on your logs and see if you’re OOM?To disable queue you can try this.demo.launch(show_api=False, enable_queue=False)But the queue is niceit won’t help disable it if it’s OOM.
2023-01-26T18:00:40Z
Ohhh… you’re probably right ! It’s probably OOM.Let me check and if needed I’ll remove some of the examples…
2023-01-26T18:22:21Z
@radameshow do I check memory usage ?I don’t see any errors on the container logs when I enable debug.Removing some of the example images made it not error out as often. I’ll leave it like this for now.
2023-01-26T19:26:56Z
@thiagohersanhere you can use theeveryparam to have a live update of your component.you need the queue enabled, though since it uses websockets under the hood.import gradio as gr
import psutil

def get_system_memory():
    memory = psutil.virtual_memory()
    memory_percent = memory.percent
    memory_used = memory.used / (1024.0 ** 3)
    memory_total = memory.total / (1024.0 ** 3)
    return {"percent": f"{memory_percent}%", "used": f"{memory_used:.3f}GB", "total": f"{memory_total:.3f}GB"}


with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column():
            gr.Textbox(value="Hello Memory")
        with gr.Column():
            gr.JSON(get_system_memory, every=1)

demo.queue().launch(debug=True)
2023-01-26T22:38:42Z
Ace ! Thanks very much.