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
30.77k stars 2.29k forks source link

unable to run on kaggle #6132

Open ml-maddi opened 8 months ago

ml-maddi commented 8 months ago

Describe the bug

I have installed gradio using "!pip3 install gradio==3.45.0 typing_extensions==4.5.0" command.It works fine on google colab, but it doesn't work on kaggle.It loads the ui correctly, then once I try to use the url or try to interact through notebook cell output, the system crashes and restarts.

Have you searched existing issues? 🔎

Reproduction

  def predict(message, history):
      # output = message # debug mode

      output = str(llm_ans(message)).replace("\n", "<br/>")
      return output

  demo = gr.ChatInterface(
      predict,
      title = f'Adolescent Chatbot(LLama-2-7b)'
  )

  demo.queue()
  demo.launch()

Screenshot

Screenshot 2023-10-29 at 11 57 55 AM

Logs

No response

System Info

The latest version of gradio doesn't work on colab/kaggle, it shows error with typing_extensions library.

Severity

Blocking usage of gradio

psylabs commented 7 months ago

Running into the same issue in any jupyter notebook. The hello world example shared on the quickstart does not work https://www.gradio.app/guides/quickstart https://colab.research.google.com/drive/18ODkJvyxHutTN0P5APWyGFO_xwNcgHDZ?usp=sharing#scrollTo=qtlFLbke2Sob

module 'gradio' has no attribute 'inputs'

freddyaboulton commented 7 months ago

Can't repro the problem on a general jupyter notebook @psylabs. The module 'gradio' has no attribute 'inputs' error means the demo is using a deprecated api like gr.inputs.Textbox().

Take a look at the migration guide: https://www.gradio.app/changelog (scroll down to the 4.0 changelog).

psylabs commented 7 months ago

Thanks! You are right, even though pip install was throwing warnings, it still worked. I'm running the example commands in this nb.

!pip install -q gradio does says tensorflow-probability 0.22.0 requires typing-extensions<4.6.0, but you have typing-extensions 4.8.0 which is incompatible.

image

But if I just ignore that warning the rest of the nb still worked. While this is true in colab, in a databricks notebooks it's complaining more violently.

image image
meet5398 commented 4 months ago

Hello, Gradio is working all right on collab. but it's flashing connection error on Kaggle notebook. and runtime also get disconnected.

AlicanAKCA commented 4 months ago

I have faced with the same error.

Alfa-beto commented 4 months ago

Hello, Gradio is working all right on collab. but it's flashing connection error on Kaggle notebook. and runtime also get disconnected.

Same here, disconnects and stop session

joaopedrosdmm commented 4 months ago

Also getting the same error and the session disconnected Any workaround?

joaopedrosdmm commented 4 months ago

I believe that kaggle limited gradio usage or any other web UI kit

mcanti commented 1 month ago

Kaggle works with ngrok: you can start gradio locally end expose the endpoint via ngrok. Still, it would be great to find a way to make gradio work with --share=True as well.