gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
31k stars 2.31k forks source link

Kaggle runtime crashes #6210

Open erfanzar opened 8 months ago

erfanzar commented 8 months ago

Describe the bug

kaggle runtime always crashes no matter which runtime type you are using (TPU, CPU, GPU) after I run

block.launch(share=True)

for example, try this code on Kaggle

import gradio as gr

with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column():
            Drug = gr.Radio(["Yes","No"])
            Family = gr.Radio(["Yes","No"])
demo.launch()

Have you searched existing issues? 🔎

Reproduction

import gradio as gr

with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column():
            Drug = gr.Radio(["Yes","No"])
            Family = gr.Radio(["Yes","No"])
demo.launch()

Screenshot

image

Logs

Keyboard interruption in main thread... closing server.
Killing tunnel 127.0.0.1:7860 <>

System Info

Kaggle TPU,CPU,GPU

Severity

Blocking usage of gradio

erfanzar commented 8 months ago

help ?

StonkGuy commented 8 months ago

I also encountered the same issue while using Gradio on Kaggle. I found a pretty neat workaround: disabling share=true and using a tunneling solution. Personally, only ngrok worked for me. To use this workaround, you'll have to install ngrok with pip (!pip install ngrok) and run it in the same cell with your code. Here's my Kaggle notebook, you can check it out and apply these fixes. https://www.kaggle.com/code/blyatcyka/roop-unleashed-patched