Spaces:
Sleeping
Sleeping
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
|
9 |
-
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# Load the server object for seizure detection
|
12 |
-
FHE_SERVER =
|
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.
|