Skip to content

Commit

Permalink
fix security check
Browse files Browse the repository at this point in the history
  • Loading branch information
Wrede committed Jun 10, 2024
1 parent b3310ac commit 1e4c64b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions fedn/network/api/v1/inference_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

from fedn.network.api.auth import jwt_auth_required
from fedn.network.api.shared import control
from fedn.network.api.v1.shared import (api_version, get_post_data_to_kwargs,
get_typed_list_headers, mdb)
from fedn.network.storage.statestore.stores.session_store import SessionStore
from fedn.network.storage.statestore.stores.shared import EntityNotFound

from .model_routes import model_store
from fedn.network.api.v1.shared import api_version

bp = Blueprint("inference", __name__, url_prefix=f"/api/{api_version}/infer")

Expand All @@ -32,8 +27,8 @@ def start_session():

session_config = {"session_id": session_id}

threading.Thread(target=control.inference_session, kwargs={"config":session_config}).start()
threading.Thread(target=control.inference_session, kwargs={"config": session_config}).start()

return jsonify({"message": "Session started"}), 200
except Exception as e:
return jsonify({"message": str(e)}), 500
return jsonify({"message": "Inference session started"}), 200
except Exception:
return jsonify({"message": "Failed to start inference session"}), 500

0 comments on commit 1e4c64b

Please sign in to comment.