gradio
gradio copied to clipboard
unable to run on kaggle
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? 🔎
- [X] I have searched and found no 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
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
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'
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).
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.
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.
Hello, Gradio is working all right on collab. but it's flashing connection error on Kaggle notebook. and runtime also get disconnected.
I have faced with the same error.
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
Also getting the same error and the session disconnected Any workaround?
I believe that kaggle limited gradio usage or any other web UI kit
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.
Please, I need help. Here is the code I run on cells for using SadTalker on Kaggle that doesn't lead me to use the WebUI:
- Â !git clone https://github.com/vinthony/SadTalker.git
- %cd SadTalker
- !pip install -r requirements.txt
- !bash scripts/download_models.sh
- !bash webui.sh
It always appears to be the same issue again and again, even if I try to install, upgrade, or downgrade a specific Gradio version.
File "app_sadtalker.py", line 35, in sadtalker_demo with gr.Row().style(equal_height=False): AttributeError: 'Row' object has no attribute 'style'
I have solved this issue on my local device by installing the required Python version, which was 3.10.6, uninstalling other versions on my device, and making sure to delete the remaining corrupted files from the older version so it can be fixed if there is a conflict with the other version.
I really appreciate your help because I have asked ChatGPT, and it was absolutely dumb.
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.
Please How to use SadTalker gradio WebUI on kaggle notebook by connecting it with Ngrok? Is Kaggle have banned using webui directly?
Simply run app.py with replace your auth ngrok token.
# - Option 2: Running with Ngrok - #
Ngrok_token = "Your_Ngrok_Tonken" #@param {type:"string"}
# Put your ngrok token here (obtainable from https://ngrok.com)
Ngrok_domain = "" # optional, leave empty if you don't have a domain
# -------------------------------- #
!pip install pyngrok
from pyngrok import ngrok, conf
import fileinput
import sys
if Ngrok_token!="":
ngrok.kill()
srv=ngrok.connect(7860 , pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token),
bind_tls=True, domain=Ngrok_domain).public_url
print(srv)
get_ipython().system("python app.py")
else:
print('An ngrok token is required. You can get one on https://ngrok.com and paste it into the ngrok_token
Simply run app.py with replace your auth ngrok token.
# - Option 2: Running with Ngrok - # Ngrok_token = "Your_Ngrok_Tonken" #@param {type:"string"} # Put your ngrok token here (obtainable from https://ngrok.com) Ngrok_domain = "" # optional, leave empty if you don't have a domain # -------------------------------- # !pip install pyngrok from pyngrok import ngrok, conf import fileinput import sys if Ngrok_token!="": ngrok.kill() srv=ngrok.connect(7860 , pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token), bind_tls=True, domain=Ngrok_domain).public_url print(srv) get_ipython().system("python app.py") else: print('An ngrok token is required. You can get one on https://ngrok.com and paste it into the ngrok_token
is it will be like this?:
!git clone https://github.com/OpenTalker/SadTalker.git
%cd SadTalker
!pip install -r requirements.txt
!bash scripts/download_models.sh
!bash webui.sh
- Option 2: Running with Ngrok -
Ngrok_token = "2jrBknQZ6W8uJ8OPGO1RXp5ws7V_6Psd5ZCbokzehpK93U5KS" #@param {type:"string"}
Put your ngrok token here (obtainable from https://ngrok.com)
Ngrok_domain = "" # optional, leave empty if you don't have a domain
--------------------------------
!pip install pyngrok
from pyngrok import ngrok, conf import fileinput import sys
if Ngrok_token!="": ngrok.kill() srv=ngrok.connect(7860 , pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token), bind_tls=True, domain=Ngrok_domain).public_url print(srv) get_ipython().system("python app.py") else: print('An ngrok token is required. You can get one on https://ngrok.com and paste it into the ngrok_token
Simply run app.py with replace your auth ngrok token.
# - Option 2: Running with Ngrok - # Ngrok_token = "Your_Ngrok_Tonken" #@param {type:"string"} # Put your ngrok token here (obtainable from https://ngrok.com) Ngrok_domain = "" # optional, leave empty if you don't have a domain # -------------------------------- # !pip install pyngrok from pyngrok import ngrok, conf import fileinput import sys if Ngrok_token!="": ngrok.kill() srv=ngrok.connect(7860 , pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token), bind_tls=True, domain=Ngrok_domain).public_url print(srv) get_ipython().system("python app.py") else: print('An ngrok token is required. You can get one on https://ngrok.com and paste it into the ngrok_token
i think the print(srv) get_ipython().system("python app.py") there is no file in sadtalker such as "python app.py" to run the webui what is the correct command to complete the process to run sadtalker gradio webui through Ngrok?
Simply run app.py with replace your auth ngrok token.
# - Option 2: Running with Ngrok - # Ngrok_token = "Your_Ngrok_Tonken" #@param {type:"string"} # Put your ngrok token here (obtainable from https://ngrok.com) Ngrok_domain = "" # optional, leave empty if you don't have a domain # -------------------------------- # !pip install pyngrok from pyngrok import ngrok, conf import fileinput import sys if Ngrok_token!="": ngrok.kill() srv=ngrok.connect(7860 , pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token), bind_tls=True, domain=Ngrok_domain).public_url print(srv) get_ipython().system("python app.py") else: print('An ngrok token is required. You can get one on https://ngrok.com and paste it into the ngrok_token
is it will be like this?:
!git clone https://github.com/OpenTalker/SadTalker.git
%cd SadTalker
!pip install -r requirements.txt
!bash scripts/download_models.sh
!bash webui.sh
- Option 2: Running with Ngrok -
Ngrok_token = "2jrBknQZ6W8uJ8OPGO1RXp5ws7V_6Psd5ZCbokzehpK93U5KS" #@param {type:"string"}
Put your ngrok token here (obtainable from https://ngrok.com)
Ngrok_domain = "" # optional, leave empty if you don't have a domain
--------------------------------
!pip install pyngrok
from pyngrok import ngrok, conf import fileinput import sys
if Ngrok_token!="": ngrok.kill() srv=ngrok.connect(7860 , pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token), bind_tls=True, domain=Ngrok_domain).public_url print(srv) get_ipython().system("python app.py") else: print('An ngrok token is required. You can get one on https://ngrok.com and paste it into the ngrok_token
Replace these two
get_ipython().system("python app.py") else:
to
python app_sadtalker.py
Replace app.py with right py (app_sadtalker.py) or rename python app_sadtalker.py to app.py
THEN you will smile
!git clone https://github.com/OpenTalker/SadTalker.git
%cd SadTalker
!pip install -r requirements.txt
!bash scripts/download_models.sh
!bash webui.sh
what about these steps:
https://github.com/gradio-app/gradio/issues/6132#issuecomment-2278965586
is this script is right?
!git clone https://github.com/vinthony/SadTalker.git
%cd SadTalker
!pip install -r requirements.txt
!bash scripts/download_models.sh
!bash webui.sh
- Option 2: Running with Ngrok -
Ngrok_token = "2jrBknQZ6W8uJ8OPGO1RXp5ws7V_6Psd5ZCbokzehpK93U5KS" #@param {type:"string"}
Put your ngrok token here (obtainable from https://ngrok.com)
Ngrok_domain = "" # optional, leave empty if you don't have a domain
--------------------------------
!pip install pyngrok
from pyngrok import ngrok, conf import fileinput import sys
if Ngrok_token!="": ngrok.kill() srv=ngrok.connect(7860 , pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token), bind_tls=True, domain=Ngrok_domain).public_url print(srv) get_ipython().system("!python app_sadtalker.py")
or make it from print(srv) get_ipython().system("!python app_sadtalker.py")
to !python app_sadtalker.py
this" !python app_sadtalker.py" option dosen't work and didn't lead me to use the webui through Ngrok)
https://www.kaggle.com/code/hebatullahhesham2/notebookca8ba0484c
is this script is right?
!git clone https://github.com/vinthony/SadTalker.git
%cd SadTalker
!pip install -r requirements.txt
!bash scripts/download_models.sh
!bash webui.sh
- Option 2: Running with Ngrok -
Ngrok_token = "2jrBknQZ6W8uJ8OPGO1RXp5ws7V_6Psd5ZCbokzehpK93U5KS" #@param {type:"string"}
Put your ngrok token here (obtainable from https://ngrok.com)
Ngrok_domain = "" # optional, leave empty if you don't have a domain
--------------------------------
!pip install pyngrok
from pyngrok import ngrok, conf import fileinput import sys
if Ngrok_token!="": ngrok.kill() srv=ngrok.connect(7860 , pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token), bind_tls=True, domain=Ngrok_domain).public_url print(srv) get_ipython().system("!python app_sadtalker.py")
or make it from print(srv) get_ipython().system("!python app_sadtalker.py")
to !python app_sadtalker.py
this" !python app_sadtalker.py" option dosen't work and didn't lead me to use the webui through Ngrok)
https://www.kaggle.com/code/hebatullahhesham2/notebookca8ba0484c
by the way u should replace with below script
print(srv)
get_ipython().system("python app_sadtalker.py")
else:
do not use !python xxxxxx just python. why did you like to use kaggle? is about free gpu runtime? kaggle was so suck for me they ban while we use something like swap face app eg.facefuion now I use webui at Huggingface space. they banned my two accounts and then I didn't use anymore.othewise kaggle do not support Huggingface repo.
https://huggingface.co/victorisgeek
I used Hugging face and duplicate vinthony/SadTalker space on Hugging face but the RunTime is max 5 hours on the free plan, I cloned this space on my device and moved it to my private space and I faced the same problem, the project is up to 7 GB