Skip to content

Commit

Permalink
update uie readme
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuChiachi committed Oct 31, 2022
1 parent 76c05e2 commit e546afd
Show file tree
Hide file tree
Showing 7 changed files with 382 additions and 687 deletions.
218 changes: 105 additions & 113 deletions model_zoo/uie/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion model_zoo/uie/deploy/python/requirements_gpu.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
onnx
onnxconverter_common
onnxruntime-gpu
onnxruntime-gpu==1.12
8 changes: 6 additions & 2 deletions model_zoo/uie/deploy/python/uie_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
import os
import math
import numpy as np
import paddle2onnx
import onnxruntime as ort

import paddle
import paddle2onnx

from paddlenlp.transformers import AutoTokenizer
from paddlenlp.utils.tools import get_bool_ids_greater_than, get_span

Expand All @@ -27,7 +30,6 @@ class InferBackend(object):
def __init__(self,
model_path_prefix,
device='cpu',
use_quantize=False,
use_fp16=False,
device_id=0):
print(">>> [InferBackend] Creating Engine ...")
Expand All @@ -37,6 +39,7 @@ def __init__(self,
opset_version=13,
enable_onnx_checker=True)
infer_model_dir = model_path_prefix.rsplit("/", 1)[0]

float_onnx_file = os.path.join(infer_model_dir, "model.onnx")
with open(float_onnx_file, "wb") as f:
f.write(onnx_model)
Expand All @@ -60,6 +63,7 @@ def __init__(self,
print(">>> [InferBackend] Use CPU to inference ...")

sess_options = ort.SessionOptions()

self.predictor = ort.InferenceSession(onnx_model,
sess_options=sess_options,
providers=providers)
Expand Down
129 changes: 0 additions & 129 deletions model_zoo/uie/evaluate.py

This file was deleted.

Loading

0 comments on commit e546afd

Please sign in to comment.