chryzxc commited on
Commit
befb5c8
·
verified ·
1 Parent(s): 32854a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -5,18 +5,18 @@ import numpy as np
5
  app = FastAPI()
6
 
7
  # Load ONNX model only
8
- session = InferenceSession("model.onnx")
9
 
10
  @app.post("/predict")
11
  async def predict(inputs: dict):
12
  # Expect pre-tokenized input from client
13
- input_ids = np.array(inputs["input_ids"], dtype=np.int64)
14
- attention_mask = np.array(inputs["attention_mask"], dtype=np.int64)
15
 
16
  # Run model
17
- outputs = session.run(None, {
18
- "input_ids": input_ids,
19
- "attention_mask": attention_mask
20
- })
21
-
22
- return {"embedding": outputs[0].tolist()}
 
5
  app = FastAPI()
6
 
7
  # Load ONNX model only
8
+ # session = InferenceSession("model.onnx")
9
 
10
  @app.post("/predict")
11
  async def predict(inputs: dict):
12
  # Expect pre-tokenized input from client
13
+ ##input_ids = np.array(inputs["input_ids"], dtype=np.int64)
14
+ #attention_mask = np.array(inputs["attention_mask"], dtype=np.int64)
15
 
16
  # Run model
17
+ #outputs = session.run(None, {
18
+ # "input_ids": input_ids,
19
+ # "attention_mask": attention_mask
20
+ #})
21
+ return "Status ok"
22
+ #return {"embedding": outputs[0].tolist()}