From c0ed81b630cd7815aa68ad4a778294641d7b3025 Mon Sep 17 00:00:00 2001 From: qmpzzpmq <405691733@qq.com> Date: Wed, 20 Apr 2022 02:16:19 +0000 Subject: [PATCH] a glitch fix in inference --- README.md | 2 +- .../inference/python/export/huggingface/hf_bart_export.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 829ef337..daf748fd 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ cd examples/inference/python then you can check the performance by simply running following commands. `hf_bart_export.py` is used to transform pytorch weights to LightSeq protobuffer. ```shell -python export/hf_bart_export.py +python export/huggingface/hf_bart_export.py python test/ls_bart.py ``` diff --git a/examples/inference/python/export/huggingface/hf_bart_export.py b/examples/inference/python/export/huggingface/hf_bart_export.py index 82a0effd..2d3c0290 100644 --- a/examples/inference/python/export/huggingface/hf_bart_export.py +++ b/examples/inference/python/export/huggingface/hf_bart_export.py @@ -2,6 +2,10 @@ Export Hugging Face BART models to protobuf/hdf5 format. """ import os +import sys +sys.path.append( + os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..", "..")) +) from collections import OrderedDict import tensorflow as tf