Update app.py
Browse files
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 |
-
|
19 |
-
|
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()}
|