Skip to content

Interfaces from Blocks#849

Merged
aliabid94 merged 4 commits into
Blocks-Devfrom
interfaces_as_components
Mar 22, 2022
Merged

Interfaces from Blocks#849
aliabid94 merged 4 commits into
Blocks-Devfrom
interfaces_as_components

Conversation

@aliabid94
Copy link
Copy Markdown
Contributor

Making Interfaces from Blocks.

Interface is implemented as a Blocks config. Frontend will use blocks only. Most Interface features are implemented, try with demo/calculator.py for example.

@omerXfaruq
Copy link
Copy Markdown
Contributor

You might want to have destination branch as Blocks-Components-v2 to show less diff, but let's merge it to Blocks-Dev when we are going to merge. It will have cleaner PR change history that way.

Comment thread demo/xray_blocks/run.py
Comment thread gradio/components.py Outdated
Comment thread gradio/components.py
Comment thread gradio/components.py Outdated
Comment thread gradio/components.py
Comment thread gradio/interface.py Outdated
Comment thread gradio/interface.py Outdated
Comment thread gradio/interface.py
Comment thread gradio/interface.py Outdated
Comment thread gradio/interface.py
Base automatically changed from Blocks-Components-v2 to Blocks-Dev March 22, 2022 17:31
@abidlabs
Copy link
Copy Markdown
Member

Btw @aliabid94 I tried testing this with a simple Interface, and it's not working for me:

gr.Interface(lambda x:x, gr.components.Textbox(), gr.components.Textbox()).launch()

The clear button works, but the submit button has no effect (and throws no error except printing "boo" in the console):

image

@aliabid94
Copy link
Copy Markdown
Contributor Author

weird I'll take a look

@abidlabs
Copy link
Copy Markdown
Member

abidlabs commented Mar 22, 2022

Ah shoot I pushed my changes to the wrong branch. These commits were supposed to be part of this branch: #848

Edit: fixed

@abidlabs abidlabs force-pushed the interfaces_as_components branch from a209b1c to 28ed62f Compare March 22, 2022 21:17
@aliabid94
Copy link
Copy Markdown
Contributor Author

The textbox component seems to not be sending the data on submit. Seems like a problem with the frontend textbox component not related to this PR, @pngwn can you take a look? @abidlabs try a demo with any other component.

@abidlabs
Copy link
Copy Markdown
Member

abidlabs commented Mar 22, 2022

Ok yeah it looks like the other components are working fine (including Number!)

@abidlabs
Copy link
Copy Markdown
Member

In that case, everything else LGTM. Should we go ahead and merge this, so that we can get work off of this for #848?

We can handle the textbox issue (and other issues that we find) in separate, smaller PRs

@aliabid94 aliabid94 merged commit 4796e55 into Blocks-Dev Mar 22, 2022
@aliabid94 aliabid94 deleted the interfaces_as_components branch March 22, 2022 22:28
aliabid94 added a commit that referenced this pull request Mar 22, 2022
* Blocks-Components-v2
- default -> default_value refactoring

* Blocks-Components-v2
- refactor output types into output_type and make them auto

* Blocks-Backend-Events
- all events are implemented

* Blocks-Backend-Events
- refactor fn: str -> Callable

* Blocks-Backend-Events
- add change event to TabItem

* Blocks Backend Components
- Remove KeyValues from components

* Blocks-Backend-Components-v2
- Resolve Components imports in inputs and outputs

* Blocks-Backend-Components-v2
- fix default parameter usage in demos

* Blocks-Backend-Components-v2
- fix default parameter usage in demos

* Blocks-Backend-Components-v2
- fix default parameter usage in demos

* Blocks-Backend-Components-v2
- docstring updates

* revert demos

* Blocks-Backend-Components-v2
- tweaks

* Blocks-Backend-Components-v2
- add change event to Tabs

* Interfaces from Blocks (#849)

Build interfaces from blocks

Co-authored-by: Ali Abid <aliabid94@gmail.com>

Co-authored-by: Ömer Faruk Özdemir <farukozderim@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Ali Abid <aliabid94@gmail.com>
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