Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryagapov committed Apr 4, 2022
1 parent adf79c5 commit 79cf99a
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 15 deletions.
1 change: 0 additions & 1 deletion openfl-docker/Dockerfile.collaborator
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ COPY ./requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ settings:
HTTP_PROXY:
HTTPS_PROXY:
NO_PROXY:


Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_dataset(self, dataset_type: str) -> np.ndarray:
"""
Return a shard dataset by type.
A simple list with elements (x, y) implemets the Shard Dataset interface.
A simple list with elements (x, y) implements the Shard Dataset interface.
"""
if dataset_type == 'train':
return self.data[:self.n_samples // 2]
Expand Down
1 change: 0 additions & 1 deletion openfl/component/aggregator/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,6 @@ def _compute_validation_related_task_metrics(self, task_name) -> bool:
self.best_model_score = agg_results
self._save_model(round_number, self.best_state_path)
is_best_model = True
# self.upload_model_to_aggregator(model_type='best')
if 'trained' in tags:
self._prepare_trained(tensor_name, origin, round_number, report, agg_results)
return is_best_model
Expand Down
7 changes: 2 additions & 5 deletions openfl/component/director/director.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,8 @@ async def set_new_experiment(
experiment_archive_path: Path,
) -> bool:
"""Set new experiment."""
tensor_dict_path = (
Path('tmp') /
f'{uuid.uuid4()}' /
f'{experiment_name}.pickle'
).absolute()
tensor_dict_path = Path('tmp') / f'{uuid.uuid4()}' / f'{experiment_name}.pickle'
tensor_dict_path = tensor_dict_path.absolute()
tensor_dict_path.parent.mkdir(parents=True, exist_ok=True)

with tensor_dict_path.open('wb') as f:
Expand Down
4 changes: 2 additions & 2 deletions openfl/component/envoy/envoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ def __init__(
self.shard_descriptor = shard_descriptor
self.shard_descriptor_config = shard_descriptor_config
self.cuda_devices = tuple(cuda_devices)
print(f'{cuda_devices=}')
logger.info(f'{cuda_devices=}')
# Optional plugins
self.cuda_device_monitor = cuda_device_monitor

Expand All @@ -75,6 +73,8 @@ def __init__(
self.is_experiment_running = False
self._health_check_future = None
self.docker_config = docker_config
envoy_info = '\n'.join([f'{k}={v}' for k, v in self.__dict__.items()])
logger.info(f'Envoy Info: \n{envoy_info}')

async def run(self):
"""Run of the envoy working cycle."""
Expand Down
1 change: 0 additions & 1 deletion openfl/component/envoy/run_collaborator.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def _shard_descriptor_from_config(shard_config: dict):

if __name__ == '__main__':
args = _parse_args()
print(args.name)
with open(args.shard_config) as f:
shard_descriptor_config = yaml.safe_load(f)
shard_descriptor = _shard_descriptor_from_config(shard_descriptor_config)
Expand Down
4 changes: 2 additions & 2 deletions openfl/utilities/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __exit__(self, exc_type, exc_value, traceback):
shutil.rmtree(self.experiment_name, ignore_errors=True)
if self.experiment_work_dir in sys.path:
sys.path.remove(self.experiment_work_dir)
os.remove(self.data_file_path)
self.data_file_path.unlink(missing_ok=True)


def dump_requirements_file(
Expand All @@ -95,7 +95,7 @@ def dump_requirements_file(
if prefixes is None:
prefixes = set()
elif type(prefixes) is str:
prefixes = set(prefixes,)
prefixes = set(prefixes, )
else:
prefixes = set(prefixes)

Expand Down

0 comments on commit 79cf99a

Please sign in to comment.