diff --git a/gradio.egg-info/PKG-INFO b/gradio.egg-info/PKG-INFO index 5d860aa75d..e8ce2ad52d 100644 --- a/gradio.egg-info/PKG-INFO +++ b/gradio.egg-info/PKG-INFO @@ -382,7 +382,7 @@ if __name__ == "__main__": ![blocks_flipper interface](demo/blocks_flipper/screenshot.gif) -If you are interested in how Blocks works, [read its dedicated Guide](introduction_to_blocks). +If you are interested in how Blocks works, [read its dedicated Guide](https://gradio.app/introduction_to_blocks/). ### Sharing Demos 🌎 diff --git a/gradio/components.py b/gradio/components.py index e8e724731e..b507b5a5be 100644 --- a/gradio/components.py +++ b/gradio/components.py @@ -3580,9 +3580,7 @@ class Dataset(Clickable, Component): visible (bool): If False, component will be hidden. """ Component.__init__(self, visible=visible, elem_id=elem_id, **kwargs) - self.components = ( - components # [get_component_instance(c).unrender() for c in components] - ) + self.components = [get_component_instance(c, render=False) for c in components] self.type = type self.headers = headers or [c.label for c in self.components] self.samples = samples @@ -3694,13 +3692,18 @@ def component(cls_name: str) -> Component: return obj -def get_component_instance(comp: str | dict | Component) -> Component: +def get_component_instance(comp: str | dict | Component, render=True) -> Component: if isinstance(comp, str): - return component(comp) + component_obj = component(comp) + if not (render): + component_obj.unrender() + return component_obj elif isinstance(comp, dict): name = comp.pop("name") component_cls = component_or_layout_class(name) component_obj = component_cls(**comp) + if not (render): + component_obj.unrender() return component_obj elif isinstance(comp, Component): return comp diff --git a/gradio/interface.py b/gradio/interface.py index d156ab52ac..0b73a722f6 100644 --- a/gradio/interface.py +++ b/gradio/interface.py @@ -201,8 +201,12 @@ class Interface(Blocks): ) self.cache_examples = False - self.input_components = [get_component_instance(i).unrender() for i in inputs] - self.output_components = [get_component_instance(o).unrender() for o in outputs] + self.input_components = [ + get_component_instance(i, render=False) for i in inputs + ] + self.output_components = [ + get_component_instance(o, render=False) for o in outputs + ] for component in self.input_components + self.output_components: if not ( diff --git a/ui/packages/app/src/Blocks.svelte b/ui/packages/app/src/Blocks.svelte index 1c88a1b5e4..ee6ca7b41c 100644 --- a/ui/packages/app/src/Blocks.svelte +++ b/ui/packages/app/src/Blocks.svelte @@ -114,7 +114,6 @@ acc[next.id] = next; return acc; }, {} as { [id: number]: Component }); - console.log(instance_map); function load_component( name: T @@ -132,7 +131,6 @@ async function walk_layout(node: LayoutNode) { let instance = instance_map[node.id]; - console.log(node.id, instance); const _component = (await _component_map.get(instance.type)).component; instance.component = _component.Component; if (_component.modes.length > 1) {