•   over 1 year ago

Failed adding gradio app to my project

Hi everyone!

I was trying to add a simple gradio app to my workbench project using this guide:
https://docs.nvidia.com/ai-workbench/user-guide/latest/quickstart/quickstart-custom-app.html#quickstart-custom-app

But it fails to start it and reports the following error in the logs:
```
{"level":"error","error":"(Container project-ai-workbench) bash -lc \"PROXY_PREFIX=\\\"/projects/ai-workbench/applications/gradio-app\\\"; PROXY_PREFIX=\\\"/projects/ai-workbench/applications/gradio-app\\\" cd /project/code && PROXY_PREFIX=$PROXY_PREFIX python3 app.py\": exit status 1","project_name":"ai-workbench","application_name":"gradio-app","time":"2024-09-09T18:15:05-05:00","message":"failed to execute launch command."}
```
When I log into the container and try running the same startup command it complains with the slightly more detailed error:

```
bash: cd: /project/code: Permission denied
```
The jupyterlab runs just fine in the same container. Looks like I missing some permissions configuration in my spec.yaml? Thank you!

  • 5 comments

  • Manager   •   over 1 year ago

    HI Dmitry

    There is an issue with gradio. Follow the instructions in the link below to fix it.

    https://forums.developer.nvidia.com/t/support-workbench-example-project-hybrid-rag/288565/55?u=twhitehouse

    Tyler

  •   •   over 1 year ago

    Thank you, Tyler.

    I have pinned fastapi==0.112.2, but the gradio app still fails to start. Here is the startup log:

    Traceback (most recent call last):
    File "/project/code/app.py", line 17, in
    demo = gr.Interface(
    File "/home/workbench/.local/lib/python3.10/site-packages/gradio/interface.py", line 476, in __init__
    self.flagging_callback.setup(
    File "/home/workbench/.local/lib/python3.10/site-packages/gradio/flagging.py", line 140, in setup
    os.makedirs(flagging_dir, exist_ok=True)
    File "/usr/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
    PermissionError: [Errno 13] Permission denied: 'flagged'

  •   •   over 1 year ago

    Still having this problem...

  • Manager   •   over 1 year ago

    Can you create a support bundle (https://docs.nvidia.com/ai-workbench/user-guide/latest/troubleshooting/logging.html#create-a-support-bundle-for-troubleshooting) and drop it here? It should container more logs that can help us pinpoint the issue. Thanks!

  •   •   over 1 year ago

    I have temporarily disabled Gradio flagging by instantiating my Interface like below and that solved my problem:

    demo = gr.Interface(
    allow_flagging="never",
    ...
    )

    Thanks for looking into this for me!

Comments are closed.