Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface Preview in Saved Notebooks #1429

Open
merveenoyan opened this issue May 31, 2022 · 10 comments
Open

Interface Preview in Saved Notebooks #1429

merveenoyan opened this issue May 31, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@merveenoyan
Copy link
Contributor

When I save a colab notebook or any notebook that has Gradio UI, below shows up instead of a preview of a UI. That would be nice to save a preview of UI even if it doesn't run.
Ekran Resmi 2022-05-31 14 38 11
Also in kaggle I get below.
Ekran Resmi 2022-05-31 14 39 01

It's probably not high priority but a veeeery nice to have 🙂
cc @osanseviero since we discussed it.

@omerXfaruq
Copy link
Contributor

omerXfaruq commented May 31, 2022

Thx for the suggestion! Hmm, it would be not that critical but nice to have I presume. Can't think of a way on doing that immediately, do you guys have any idea on how to do it? @merveenoyan, @osanseviero, @abidlabs?

@omerXfaruq omerXfaruq added the enhancement New feature or request label May 31, 2022
@omerXfaruq omerXfaruq added this to the 3.x milestone May 31, 2022
@merveenoyan
Copy link
Contributor Author

merveenoyan commented May 31, 2022

I think it's good, given even if we want it to be adopted on Kaggle someone who comes across this for the first time will not be able to understand what it's used for (nor for Colab, so it causes loss in getting people on board sort of)
As for implementation I can't think of it, but even sort of a screenshot and when you bring your cursor over it a text saying "run the notebook to interact with UI" would be good. (or text over screenshot would suffice)

@abidlabs
Copy link
Member

abidlabs commented May 31, 2022

Interesting, it might be possible by taking a screenshot via javascript when the interface is launched and using that as the fallback if the share URL cannot be found or no longer corresponds to the running Gradio app.

I actually think this is a good idea because I've heard from some users that we're starting to have collisions in the share URL, meaning that user A launches an Interface with the URL xxxxx.gradio.app, closes the notebook, then user B launches an Interface that also happens to have the same URL xxxxx.gradio. When user A opens their notebook again, it will show user B's interface embedded in their notebook.

Will add this to the roadmap

@radames
Copy link
Contributor

radames commented May 31, 2022

curious @abidlabs, would be possible to run Gradio Interface inside the notebooks without the proxy?

@abidlabs
Copy link
Member

Ah so without the ssh tunnel / public URL? We haven't been able to figure out how to expose the local host inside notebook environments without using the ssh tunnel / public URL. I'm pretty sure its impossible, but would love to be proven wrong if you have any ideas @radames

@omerXfaruq
Copy link
Contributor

@abidlabs do you know why sharing is default in colab notebooks? Because it is more handy?

@abidlabs
Copy link
Member

abidlabs commented May 31, 2022

The reason I mentioned above -- basically, the Interface runs locally on colab machine's port 7860, but that port is not exposed to users. We haven't been able to figure out how to expose the local host inside notebook environments without using the ssh tunnel / public URL / share=True.

@omerXfaruq
Copy link
Contributor

What I actually meant was, we could have share off in Colab by default as well, like in local case.

@abidlabs
Copy link
Member

abidlabs commented Jun 1, 2022

Ah that was the default behavior initially, but then people would click on the localhost link expecting to see the Interface, and it was not visible. That's why we made it share=True on colab. We should probably make it so that people can turn share=False in colab if they want (currently it forces share=True), we have an upcoming contribution that will do this: #1371

@merveenoyan
Copy link
Contributor Author

In Kaggle it currently looks like this for 72 hours thanks to sharing:
Ekran Resmi 2022-09-15 17 28 34 (I haven't checked how it'll look after 72 hours so correct me if I'm wrong 😅)
I was wondering if we could put a preview of the interface after 72 hours, would this work? @freddyaboulton @abidlabs

@abidlabs abidlabs removed this from the 3.x milestone Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
4 participants