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
33.63k stars 2.55k forks source link

Make gradio web component embedding look nicer and direct to Spaces #1957

Closed abidlabs closed 1 year ago

abidlabs commented 2 years ago

We used to have a nice gray border around embedded gradio demos with some additional information like this at the bottom:

image

I think this would a nice enhancement to bring back to embedded gradio web components and would distinguish the web component from an ordinary iframe embedding.

TLDR: when embedding a Gradio app from Spaces, it would be nice to have links to the original Space and code.

abidlabs commented 2 years ago

Increasingly seeing more websites which wrap Gradio Spaces, e.g.

It would be great if these embeddings had some way of redirecting people back to Spaces. (We could make this the default but allow people to turn off the frame if they need a minimalist embed), wdyt @aliabid94 @pngwn?

pngwn commented 2 years ago

web component from an ordinary iframe embedding

The iframe embed is a web component embed too, everything uses the webcomponent whether it is wrapped in an iframe or not.

But yes to this, I'll take a look since I'm looking at the styling currently. Should be straightforward, we can disable it for spaces but enable it by default, so it appears when people are embedding elsewhere.

julien-c commented 1 year ago

tag @gary149 @pierrci

abidlabs commented 1 year ago

In addition, it should display something gracefully if the underlying Space errors out or is asleep (given that Spaces will now go to sleep after 72 hours)