Skip to content

Commit

Permalink
Use active model if model_id not in session_config
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminastrand committed Nov 26, 2024
1 parent dac41b9 commit c9dd124
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fedn/network/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,13 @@ def start_session(
:return: A dict with success or failure message and session config.
:rtype: dict
"""
if model_id is None:
response = requests.get(self._get_url_api_v1("models/active"), verify=self.verify, headers=self.headers)
if response.status_code == 200:
model_id = response.json()
else:
return response.json()

response = requests.post(
self._get_url_api_v1("sessions"),
json={
Expand Down

0 comments on commit c9dd124

Please sign in to comment.