batuergun commited on
Commit
684641d
1 Parent(s): 4040d43

fhe model client

Browse files
common.py CHANGED
@@ -5,6 +5,9 @@ from pathlib import Path
5
  # This repository's directory
6
  REPO_DIR = Path(__file__).parent
7
 
 
 
 
8
  # This repository's main necessary folders
9
  SEIZURE_DETECTION_MODEL_PATH = REPO_DIR / "seizure_detection/deployment"
10
  KEYS_PATH = REPO_DIR / ".fhe_keys"
 
5
  # This repository's directory
6
  REPO_DIR = Path(__file__).parent
7
 
8
+ CURRENT_DIR = Path(__file__).parent
9
+ DEPLOYMENT_DIR = CURRENT_DIR / "deployment_files"
10
+
11
  # This repository's main necessary folders
12
  SEIZURE_DETECTION_MODEL_PATH = REPO_DIR / "seizure_detection/deployment"
13
  KEYS_PATH = REPO_DIR / ".fhe_keys"
{seizure_detection/deployment → deployment_files}/client.zip RENAMED
File without changes
{seizure_detection/deployment → deployment_files}/server.zip RENAMED
File without changes
server.py CHANGED
@@ -5,11 +5,15 @@ from typing import List
5
  from fastapi import FastAPI, File, Form, UploadFile
6
  from fastapi.responses import JSONResponse, Response
7
 
8
- from common import SERVER_TMP_PATH
9
- from client_server_interface import FHEServer
 
 
 
 
10
 
11
  # Load the server object for seizure detection
12
- FHE_SERVER = FHEServer(model_path="ThomasCdnns/EEG-Seizure-Detection/resolve/main/seizure_detection_model-4.pth")
13
 
14
  def get_server_file_path(name, user_id):
15
  """Get the correct temporary file path for the server.
 
5
  from fastapi import FastAPI, File, Form, UploadFile
6
  from fastapi.responses import JSONResponse, Response
7
 
8
+ from concrete.ml.deployment import FHEModelServer
9
+
10
+ from common import (
11
+ DEPLOYMENT_DIR,
12
+ SERVER_TMP_PATH
13
+ )
14
 
15
  # Load the server object for seizure detection
16
+ FHE_SERVER = FHEModelServer(DEPLOYMENT_DIR)
17
 
18
  def get_server_file_path(name, user_id):
19
  """Get the correct temporary file path for the server.