VaultChem commited on
Commit
d73a93b
·
verified ·
1 Parent(s): 3974377

Upload server.py

Browse files
Files changed (1) hide show
  1. server.py +3 -3
server.py CHANGED
@@ -9,7 +9,7 @@ from pathlib import Path
9
  current_dir = Path(__file__).parent
10
 
11
  # Load the model
12
- fhe_model_HLM = FHEModelServer(
13
  Path.joinpath(current_dir, "fhe_model")
14
  )
15
  class PredictRequest(BaseModel):
@@ -28,10 +28,10 @@ def root():
28
 
29
 
30
  @app.post("/predict")
31
- def predict_HLM(query: PredictRequest):
32
  encrypted_encoding = base64.b64decode(query.encrypted_encoding)
33
  evaluation_key = base64.b64decode(query.evaluation_key)
34
- prediction = fhe_model_HLM.run(encrypted_encoding, evaluation_key)
35
 
36
  # Encode base64 the prediction
37
  encoded_prediction = base64.b64encode(prediction).decode()
 
9
  current_dir = Path(__file__).parent
10
 
11
  # Load the model
12
+ fhe_model = FHEModelServer(
13
  Path.joinpath(current_dir, "fhe_model")
14
  )
15
  class PredictRequest(BaseModel):
 
28
 
29
 
30
  @app.post("/predict")
31
+ def predict(query: PredictRequest):
32
  encrypted_encoding = base64.b64decode(query.encrypted_encoding)
33
  evaluation_key = base64.b64decode(query.evaluation_key)
34
+ prediction = fhe_model.run(encrypted_encoding, evaluation_key)
35
 
36
  # Encode base64 the prediction
37
  encoded_prediction = base64.b64encode(prediction).decode()