-
Notifications
You must be signed in to change notification settings - Fork 0
/
BERT.yml
53 lines (53 loc) · 1.45 KB
/
BERT.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: BERT
framework:
name: Onnxruntime
version: 1.7.1
version: 1.0
description: >
MLPerf_BERT.
references:
- https://github.com/mlcommons/inference/tree/master/language/bert
- https://zenodo.org/record/3733910
license: Apache License, Version 2.0
modality: general
inputs:
- type: general
description: input id
parameters:
element_type: int64
- type: general
description: input mask
parameters:
element_type: int64
- type: general
description: segment id
parameters:
element_type: int64
outputs:
- type: general
description: start position to the answer
parameters:
element_type: int64
- type: general
description: end position to the answe
parameters:
element_type: int64
model:
is_archive:
false
graph_path: https://s3.amazonaws.com/store.carml.org/models/onnxruntime/bert.onnx
graph_checksum: 819b25b19cd8e59080c10892689750ca
preprocess: |
def preprocess(ctx, data):
import numpy as np
cur = eval_features[int(data)]
return np.array(cur.input_ids, dtype = np.int64), np.array(cur.input_mask, dtype = np.int64), np.array(cur.segment_ids, dtype = np.int64)
postprocess: |
def postprocess(ctx, data):
import numpy as np
import json
res = np.stack([data[0], data[1]], axis = -1).squeeze(0).tolist()
return [json.dumps(res)]
attributes:
kind: Transformer
manifest_author: Yen-Hsiang Chang