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

Adding missing embedded components on docs #3027

Merged
merged 14 commits into from
Jan 24, 2023

Conversation

aliabd
Copy link
Collaborator

@aliabd aliabd commented Jan 19, 2023

This adds missing embedded components to the docs, and fixes some broken ones.

  • Adds embedded component demo for Dataset, Examples, Progress, UploadButton, and Interpretation
  • Fixes broken image on Gallery embedded component
  • Removes the footer on LinePlot

Live on staging: https://www.gradio-staging.com/docs/main though obviously with the current css issues on main

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jan 20, 2023

🎉 The demo notebooks match the run.py files! 🎉

@gradio-pr-bot
Copy link
Collaborator

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-3027-all-demos

[txt, txt_2],
txt_3,
combine,
cache_examples=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cache examples here?

Comment on lines 9 to 19
with gr.Blocks(css=css) as demo:
with gr.Row():
with gr.Column(elem_id="col_1"):
txt = gr.Textbox(label="Input 1", elem_id="input_1_text")
with gr.Column(elem_id="col_2"):
txt_2 = gr.Textbox(label="Input 2", elem_id="input_2_text")
with gr.Column(elem_id="col_3"):
btn = gr.Button(value="Combine Inputs", elem_id="combine_button")
with gr.Column(elem_id="col_4"):
txt_3 = gr.Textbox(value="", label="Output", elem_id="output_text")
btn.click(combine, inputs=[txt, txt_2], outputs=[txt_3])
Copy link
Member

@abidlabs abidlabs Jan 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion would be to include an images or something other than text as one of the inputs since we already showcase text in the Dataset component as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the "combine inputs" button looks kind of weird by itself in a column. What if you put it under the first two inputs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just trying to reduce vertical space and focus the demo more on the examples component, but don't think it matters.

@@ -9,7 +9,6 @@
"https://img.etimg.com/thumb/msid-50159822,width-650,imgsize-129520,,resizemode-4,quality-100/.jpg",
"https://nationalzoo.si.edu/sites/default/files/animals/cheetah-002.jpg",
"https://images.theconversation.com/files/375893/original/file-20201218-13-a8h8uq.jpg?ixlib=rb-1.1.0&rect=16%2C407%2C5515%2C2924&q=45&auto=format&w=496&fit=clip",
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQeSdQE5kHykTdB970YGSW3AsF6MHHZzY4QiQ&usqp=CAU",
"https://www.lifegate.com/app/uploads/ghepardo-primo-piano.jpg",
"https://i.natgeofe.com/n/60004bcc-cd85-4401-8bfa-6f96551557db/cheetah-extinction-3_3x4.jpg",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why but the natgeofe image isn't being recognized as a valid URL for me. I get this:

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'https:\\i.natgeofe.com\\n\\60004bcc-cd85-4401-8bfa-6f96551557db\\cheetah-extinction-3_3x4.jpg'

@abidlabs
Copy link
Member

Went through the demos locally and they look good @aliabd! Left a few nits above but otherwise LGTM

@aliabd aliabd self-assigned this Jan 24, 2023
@aliabd aliabd merged commit 02c7bfe into main Jan 24, 2023
@aliabd aliabd deleted the aliabd/embedded-components-missing branch January 24, 2023 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants