gradio: A Space loaded with `gr.load()` is not functional

Describe the bug

While embedding the private space into the public one, UI is transitioned, but is completely unfunctional, although the private space by itself works perfectly. Dropdowns can’t be clicked, buttons don’t do anything, one can only fill a text field successfully. Also, no error log is shown. I am embedding space as I currently don’t want to share my code, hence private space load from public space.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
import os

HF_TOKEN = os.environ["HF_TOKEN"]

css = """
.column-frame {
    border: 2px solid #AAA;
    border-radius: 10px;
    padding: 10px;
    margin: 10px;
}
"""

with gr.Blocks(theme=gr.themes.Soft(),css=css) as demo:
    gr.load("private_space_path", src="spaces", hf_token=HF_TOKEN)

demo.launch(debug=True)

Screenshot

No response

Logs

No response

System Info

gradio=4.8.0
env=Hugging Face Spaces

Severity

Blocking usage of gradio

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

@Aillian I think you would have to call render:

import gradio as gr

with gr.Blocks() as app:
    gr.load("your/private_space", hf_token="yourHfToken", src="spaces").render()

app.queue().launch()

See #7996