diff --git a/python/eggroll/cli/commands/task.py b/python/eggroll/cli/commands/task.py index a479bc8da..7d493f8fc 100644 --- a/python/eggroll/cli/commands/task.py +++ b/python/eggroll/cli/commands/task.py @@ -138,9 +138,9 @@ def download(ctx, **kwargs): client: EggrollClient = ctx.obj["client"] download_dir = kwargs.get("download_dir") client._session_id = kwargs.get("session_id") - status = client.query_status() - if status["message"]: - return prettify(status) + response = client.query_status() + if response.get("message", None): + return prettify(response) os.makedirs(download_dir, exist_ok=True) with tempfile.TemporaryDirectory() as temp_dir: diff --git a/python/eggroll/deepspeed/utils/__init__.py b/python/eggroll/deepspeed/utils/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/python/eggroll/deepspeed/utils/params_utils.py b/python/eggroll/deepspeed/utils/params_utils.py new file mode 100644 index 000000000..babb86ad2 --- /dev/null +++ b/python/eggroll/deepspeed/utils/params_utils.py @@ -0,0 +1,21 @@ +# +# Copyright 2019 The FATE Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +def filter_invalid_params(self, value=None, **kwargs): + _p = {} + for _k, _v in kwargs.items(): + if _v is not value: + _p[_k] = _v + return _p