Skip to content

Commit

Permalink
Merge branch 'master' into feature/SK-560
Browse files Browse the repository at this point in the history
  • Loading branch information
Wrede committed Nov 17, 2023
2 parents 0808d43 + 36cf7f7 commit e8caab4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
5 changes: 0 additions & 5 deletions fedn/fedn/network/api/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import uuid

import requests

__all__ = ['APIClient']
Expand Down Expand Up @@ -139,9 +137,6 @@ def start_session(self, session_id=None, round_timeout=180, rounds=5, round_buff
:return: A dict with success or failure message and session config.
:rtype: dict
"""
# If session id is None, generate a random session id.
if session_id is None:
session_id = str(uuid.uuid4())
response = requests.post(self._get_url('start_session'), json={
'session_id': session_id,
'round_timeout': round_timeout,
Expand Down
28 changes: 15 additions & 13 deletions fedn/fedn/network/api/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import copy
import os
import threading
import uuid
from io import BytesIO

from flask import jsonify, send_from_directory
Expand Down Expand Up @@ -869,19 +870,20 @@ def start_session(
model_id = self.statestore.get_latest_model()

# Setup session config
session_config = {"session_id": session_id,
"round_timeout": round_timeout,
"buffer_size": round_buffer_size,
"model_id": model_id,
"rounds": rounds,
"delete_models_storage": delete_models,
"clients_required": min_clients,
"clients_requested": requested_clients,
"task": (''),
"validate": validate,
"helper_type": helper,
"model_tag": model_tag
}
session_config = {
"session_id": session_id if session_id else str(uuid.uuid4()),
"round_timeout": round_timeout,
"buffer_size": round_buffer_size,
"model_id": model_id,
"rounds": rounds,
"delete_models_storage": delete_models,
"clients_required": min_clients,
"clients_requested": requested_clients,
"task": (""),
"validate": validate,
"helper_type": helper,
"model_tag": model_tag
}

# Start session
threading.Thread(
Expand Down

0 comments on commit e8caab4

Please sign in to comment.