We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
BUG: model info check fails when model is sklearn pipeline
to reproduce:
https://www.kaggle.com/itay94/notebook6f16624759

![image](https://user-images.githubusercontent.com/20860465/147880701-f8edc031-bc19-4a1b-a30b-6f9f8b89b782.png)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `deepchecks/checks/overview/model_info.py`
Content:
```
1 # ----------------------------------------------------------------------------
2 # Copyright (C) 2021 Deepchecks (https://www.deepchecks.com)
3 #
4 # This file is part of Deepchecks.
5 # Deepchecks is distributed under the terms of the GNU Affero General
6 # Public License (version 3 or later).
7 # You should have received a copy of the GNU Affero General Public License
8 # along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.
9 # ----------------------------------------------------------------------------
10 #
11 """Module contains model_info check."""
12 import pandas as pd
13 from sklearn.base import BaseEstimator
14 
15 from deepchecks import ModelOnlyBaseCheck, CheckResult
16 from deepchecks.utils.validation import model_type_validation
17 
18 
19 __all__ = ['ModelInfo']
20 
21 
22 class ModelInfo(ModelOnlyBaseCheck):
23     """Summarize given model parameters."""
24 
25     def run(self, model: BaseEstimator) -> CheckResult:
26         """Run check.
27 
28         Args:
29             model (BaseEstimator): A scikit-learn-compatible fitted estimator instance
30 
31         Returns:
32             CheckResult: value is dictionary in format {type: <model_type>, params: <model_params_dict>}
33         """
34         return self._model_info(model)
35 
36     def _model_info(self, model: BaseEstimator):
37         model_type_validation(model)
38         model_type = type(model).__name__
39         model_params = model.get_params()
40         default_params = type(model)().get_params()
41 
42         # Create dataframe to show
43         model_param_df = pd.DataFrame(model_params.items(), columns=['Parameter', 'Value'])
44         model_param_df['Default'] = model_param_df['Parameter'].map(lambda x: default_params.get(x, ''))
45 
46         def highlight_not_default(data):
47             n = len(data)
48             if data['Value'] != data['Default']:
49                 return n * ['background-color: lightblue']
50             else:
51                 return n * ['']
52 
53         model_param_df = model_param_df.style.apply(highlight_not_default, axis=1).hide_index()
54 
55         value = {'type': model_type, 'params': model_params}
56         footnote = '<p style="font-size:0.7em"><i>Colored rows are parameters with non-default values</i></p>'
57         display = [f'Model Type: {model_type}', model_param_df, footnote]
58 
59         return CheckResult(value, header='Model Info', display=display)
60
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/deepchecks/checks/overview/model_info.py b/deepchecks/checks/overview/model_info.py
--- a/deepchecks/checks/overview/model_info.py
+++ b/deepchecks/checks/overview/model_info.py
@@ -14,6 +14,7 @@
 
 from deepchecks import ModelOnlyBaseCheck, CheckResult
 from deepchecks.utils.validation import model_type_validation
+from deepchecks.utils.model import get_model_of_pipeline
 
 
 __all__ = ['ModelInfo']
@@ -31,13 +32,11 @@
         Returns:
             CheckResult: value is dictionary in format {type: <model_type>, params: <model_params_dict>}
         """
-        return self._model_info(model)
-
-    def _model_info(self, model: BaseEstimator):
         model_type_validation(model)
-        model_type = type(model).__name__
-        model_params = model.get_params()
-        default_params = type(model)().get_params()
+        estimator = get_model_of_pipeline(model)
+        model_type = type(estimator).__name__
+        model_params = estimator.get_params()
+        default_params = type(estimator)().get_params()
 
         # Create dataframe to show
         model_param_df = pd.DataFrame(model_params.items(), columns=['Parameter', 'Value'])

{"golden_diff": "diff --git a/deepchecks/checks/overview/model_info.py b/deepchecks/checks/overview/model_info.py\n--- a/deepchecks/checks/overview/model_info.py\n+++ b/deepchecks/checks/overview/model_info.py\n@@ -14,6 +14,7 @@\n \n from deepchecks import ModelOnlyBaseCheck, CheckResult\n from deepchecks.utils.validation import model_type_validation\n+from deepchecks.utils.model import get_model_of_pipeline\n \n \n __all__ = ['ModelInfo']\n@@ -31,13 +32,11 @@\n         Returns:\n             CheckResult: value is dictionary in format {type: <model_type>, params: <model_params_dict>}\n         \"\"\"\n-        return self._model_info(model)\n-\n-    def _model_info(self, model: BaseEstimator):\n         model_type_validation(model)\n-        model_type = type(model).__name__\n-        model_params = model.get_params()\n-        default_params = type(model)().get_params()\n+        estimator = get_model_of_pipeline(model)\n+        model_type = type(estimator).__name__\n+        model_params = estimator.get_params()\n+        default_params = type(estimator)().get_params()\n \n         # Create dataframe to show\n         model_param_df = pd.DataFrame(model_params.items(), columns=['Parameter', 'Value'])\n", "issue": "BUG: model info check fails when model is sklearn pipeline\nto reproduce:\r\nhttps://www.kaggle.com/itay94/notebook6f16624759\r\n\r\n![image](https://user-images.githubusercontent.com/20860465/147880701-f8edc031-bc19-4a1b-a30b-6f9f8b89b782.png)\r\n\n", "before_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021 Deepchecks (https://www.deepchecks.com)\n#\n# This file is part of Deepchecks.\n# Deepchecks is distributed under the terms of the GNU Affero General\n# Public License (version 3 or later).\n# You should have received a copy of the GNU Affero General Public License\n# along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.\n# ----------------------------------------------------------------------------\n#\n\"\"\"Module contains model_info check.\"\"\"\nimport pandas as pd\nfrom sklearn.base import BaseEstimator\n\nfrom deepchecks import ModelOnlyBaseCheck, CheckResult\nfrom deepchecks.utils.validation import model_type_validation\n\n\n__all__ = ['ModelInfo']\n\n\nclass ModelInfo(ModelOnlyBaseCheck):\n    \"\"\"Summarize given model parameters.\"\"\"\n\n    def run(self, model: BaseEstimator) -> CheckResult:\n        \"\"\"Run check.\n\n        Args:\n            model (BaseEstimator): A scikit-learn-compatible fitted estimator instance\n\n        Returns:\n            CheckResult: value is dictionary in format {type: <model_type>, params: <model_params_dict>}\n        \"\"\"\n        return self._model_info(model)\n\n    def _model_info(self, model: BaseEstimator):\n        model_type_validation(model)\n        model_type = type(model).__name__\n        model_params = model.get_params()\n        default_params = type(model)().get_params()\n\n        # Create dataframe to show\n        model_param_df = pd.DataFrame(model_params.items(), columns=['Parameter', 'Value'])\n        model_param_df['Default'] = model_param_df['Parameter'].map(lambda x: default_params.get(x, ''))\n\n        def highlight_not_default(data):\n            n = len(data)\n            if data['Value'] != data['Default']:\n                return n * ['background-color: lightblue']\n            else:\n                return n * ['']\n\n        model_param_df = model_param_df.style.apply(highlight_not_default, axis=1).hide_index()\n\n        value = {'type': model_type, 'params': model_params}\n        footnote = '<p style=\"font-size:0.7em\"><i>Colored rows are parameters with non-default values</i></p>'\n        display = [f'Model Type: {model_type}', model_param_df, footnote]\n\n        return CheckResult(value, header='Model Info', display=display)\n", "path": "deepchecks/checks/overview/model_info.py"}], "after_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021 Deepchecks (https://www.deepchecks.com)\n#\n# This file is part of Deepchecks.\n# Deepchecks is distributed under the terms of the GNU Affero General\n# Public License (version 3 or later).\n# You should have received a copy of the GNU Affero General Public License\n# along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.\n# ----------------------------------------------------------------------------\n#\n\"\"\"Module contains model_info check.\"\"\"\nimport pandas as pd\nfrom sklearn.base import BaseEstimator\n\nfrom deepchecks import ModelOnlyBaseCheck, CheckResult\nfrom deepchecks.utils.validation import model_type_validation\nfrom deepchecks.utils.model import get_model_of_pipeline\n\n\n__all__ = ['ModelInfo']\n\n\nclass ModelInfo(ModelOnlyBaseCheck):\n    \"\"\"Summarize given model parameters.\"\"\"\n\n    def run(self, model: BaseEstimator) -> CheckResult:\n        \"\"\"Run check.\n\n        Args:\n            model (BaseEstimator): A scikit-learn-compatible fitted estimator instance\n\n        Returns:\n            CheckResult: value is dictionary in format {type: <model_type>, params: <model_params_dict>}\n        \"\"\"\n        model_type_validation(model)\n        estimator = get_model_of_pipeline(model)\n        model_type = type(estimator).__name__\n        model_params = estimator.get_params()\n        default_params = type(estimator)().get_params()\n\n        # Create dataframe to show\n        model_param_df = pd.DataFrame(model_params.items(), columns=['Parameter', 'Value'])\n        model_param_df['Default'] = model_param_df['Parameter'].map(lambda x: default_params.get(x, ''))\n\n        def highlight_not_default(data):\n            n = len(data)\n            if data['Value'] != data['Default']:\n                return n * ['background-color: lightblue']\n            else:\n                return n * ['']\n\n        model_param_df = model_param_df.style.apply(highlight_not_default, axis=1).hide_index()\n\n        value = {'type': model_type, 'params': model_params}\n        footnote = '<p style=\"font-size:0.7em\"><i>Colored rows are parameters with non-default values</i></p>'\n        display = [f'Model Type: {model_type}', model_param_df, footnote]\n\n        return CheckResult(value, header='Model Info', display=display)\n", "path": "deepchecks/checks/overview/model_info.py"}]}