WenqingZhang commited on
Commit
aff01b9
·
verified ·
1 Parent(s): f32e899

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +4 -3
server.py CHANGED
@@ -6,11 +6,14 @@ from pydantic import BaseModel
6
  import base64
7
  from pathlib import Path
8
 
 
 
 
9
  current_dir = Path(__file__).parent
10
 
11
  # Load the model
12
  fhe_model = FHEModelServer("deployment/financial_rating")
13
- fhe_legal_model = FHEModelServer("deployment/legal_rating")
14
  class PredictRequest(BaseModel):
15
  evaluation_key: str
16
  encrypted_encoding: str
@@ -25,8 +28,6 @@ def root():
25
 
26
  @app.post("/predict_sentiment")
27
  def predict_sentiment(query: PredictRequest):
28
- fhe_model = FHEModelServer("deployment/financial_rating")
29
-
30
  encrypted_encoding = base64.b64decode(query.encrypted_encoding)
31
  evaluation_key = base64.b64decode(query.evaluation_key)
32
  prediction = fhe_model.run(encrypted_encoding, evaluation_key)
 
6
  import base64
7
  from pathlib import Path
8
 
9
+ current_dir = Path(__file__).parent
10
+
11
+
12
  current_dir = Path(__file__).parent
13
 
14
  # Load the model
15
  fhe_model = FHEModelServer("deployment/financial_rating")
16
+
17
  class PredictRequest(BaseModel):
18
  evaluation_key: str
19
  encrypted_encoding: str
 
28
 
29
  @app.post("/predict_sentiment")
30
  def predict_sentiment(query: PredictRequest):
 
 
31
  encrypted_encoding = base64.b64decode(query.encrypted_encoding)
32
  evaluation_key = base64.b64decode(query.evaluation_key)
33
  prediction = fhe_model.run(encrypted_encoding, evaluation_key)