Skip to content

Commit

Permalink
📝 Writing docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrikerMan committed Jul 12, 2019
1 parent 2b9255b commit 04b44ac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/md/tensorflow_serving.md
Expand Up @@ -36,6 +36,14 @@ tensor = processor.process_x_dataset([x])

# array([[1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], dtype=int32)

# if you using BERT, you need to reformat tensor first
# ------ Only for BERT Embedding Start --------
tensor = [{
"Input-Token:0": i.tolist(),
"Input-Segment:0": np.zeros(i.shape).tolist()
} for i in tensor]
# ------ Only for BERT Embedding End ----------

# predict
r = requests.post("http://localhost:8501/v1/models/bgru:predict", json={"instances": tensor.tolist()})
preds = r.json()['predictions']
Expand Down

0 comments on commit 04b44ac

Please sign in to comment.