diff --git a/gradio/components.py b/gradio/components.py index 29aeda654b..cf33738a59 100644 --- a/gradio/components.py +++ b/gradio/components.py @@ -2898,12 +2898,6 @@ class Model3D(Component): **super().get_template_context(), } - @classmethod - def get_shortcut_implementations(cls): - return { - "Model3D": {}, - } - def preprocess_example(self, x): return {"name": x, "data": None, "is_example": True} @@ -3214,12 +3208,6 @@ class Plot(Component): def get_template_context(self): return {**super().get_template_context()} - @classmethod - def get_shortcut_implementations(cls): - return { - "plot": {}, - } - def postprocess(self, y): """ Parameters: diff --git a/gradio/inputs.py b/gradio/inputs.py index 3001ae1aeb..e5693f2167 100644 --- a/gradio/inputs.py +++ b/gradio/inputs.py @@ -512,4 +512,4 @@ class Image3D(C_Model3D): "Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components", DeprecationWarning, ) - super().__init__(label, optional=optional) + super().__init__(label=label, optional=optional) diff --git a/test/test_inputs.py b/test/test_inputs.py index 776b0ab9a0..10e26f66ce 100644 --- a/test/test_inputs.py +++ b/test/test_inputs.py @@ -763,8 +763,10 @@ class TestImage3D(unittest.TestCase): self.assertEqual( Image3D_input.get_template_context(), { - "optional": False, + "clearColor": None, "name": "image3d", + "css": {}, + "interactive": None, "label": "Upload Your 3D Image Model", }, ) @@ -778,7 +780,7 @@ class TestImage3D(unittest.TestCase): def test_in_interface(self): Image3D = media_data.BASE64_MODEL3D - iface = gr.Interface(lambda x: x, "Model3D", "Model3D") + iface = gr.Interface(lambda x: x, "model3d", "model3d") self.assertEqual( iface.process([Image3D])[0]["data"], Image3D["data"].replace("@file/gltf", ""), diff --git a/test/test_outputs.py b/test/test_outputs.py index 05f0cf85d6..c90d01ce82 100644 --- a/test/test_outputs.py +++ b/test/test_outputs.py @@ -557,11 +557,11 @@ class TestImage3D(unittest.TestCase): to_save = Image3D_output.save_flagged( tmpdirname, "Image3D_output", media_data.BASE64_MODEL3D, None ) - self.assertEqual("Image3D_output/0.gltf", to_save) + self.assertEqual("Image3D_output/0", to_save) to_save = Image3D_output.save_flagged( tmpdirname, "Image3D_output", media_data.BASE64_MODEL3D, None ) - self.assertEqual("Image3D_output/1.gltf", to_save) + self.assertEqual("Image3D_output/1", to_save) if __name__ == "__main__": diff --git a/test/test_routes.py b/test/test_routes.py index ad28360b94..57d5ba58a5 100644 --- a/test/test_routes.py +++ b/test/test_routes.py @@ -45,7 +45,9 @@ class TestRoutes(unittest.TestCase): self.assertEqual(output["data"], ["testtest"]) def test_state(self): - def predict(input, history=""): + def predict(input, history): + if history is None: + history = "" history += input return history, history