Saravanan666/pypi-org huggingface dataset:
Package: onnigiri
onnigirionnx-dividerThe purpose of this package is to create subgraphs by partitioning computational graphs in order to facilitate the development of applications.One of the problems in developing applications using deep learning models is that the DL model is not applicable by itself.
For example, they may be have unnecessary nodes and some nodes are not supported some DL tools.
This tool enable us to edit an onnx model freely and easily.InstallationFromPyPI:$ pip3 install onnigiriFromDockerhub$ docker pull idein/onnigiri:20231114UsageSSD$ onnigiri ssd-10.onnx -o ssd-10-main.onnx --from image --to Transpose_472 Transpose_661
$ onnigiri ssd-10.onnx -o ssd-10-post.onnx --from Transpose_472 Transpose_661 --to bboxes labels scoresWith docker:$ docker run --rm -it -u $UID:$GID -v $(pwd):/work idein/onnigiri:20221014 ssd-10.onnx -o ssd-10-main.onnx --from image --to Transpose_472 Transpose_661
$ docker run --rm -it -u $UID:$GID -v $(pwd):/work idein/onnigiri:20221014 ssd-10.onnx -o ssd-10-post.onnx  --from Transpose_472 Transpose_661 --to bboxes labels scoresUltraFace$ onnigiri version-RFB-640.onnx -o version-RFB-640-main.onnx --from input --to 460 scores
$ onnigiri version-RFB-640.onnx -o version-RFB-640-post.onnx --from 460 --to boxestiny-yolov3$ onnigiri tiny-yolov3-11.onnx --fix-input-shape 'input_1' '1,3,256,256' 'image_shape' '1,2' -o tiny-yolov3-11-main.onnx --from input_1 --to 'TFNodes/yolo_evaluation_layer_1/Reshape_3:0' 'model_1/leaky_re_lu_10/LeakyRelu:0' 'model_1/leaky_re_lu_5/LeakyRelu:0'
$ onnigiri tiny-yolov3-11.onnx --fix-input-shape 'input_1' '1,3,256,256' 'image_shape' '1,2' -o tiny-yolov3-11-post.onnx --from image_shape 'TFNodes/yolo_evaluation_layer_1/Reshape_3:0' 'model_1/leaky_re_lu_10/LeakyRelu:0' 'model_1/leaky_re_lu_5/LeakyRelu:0' --to 'yolonms_layer_1' 'yolonms_layer_1:1' 'yolonms_layer_1:2'Q&AHow to get the name of values?UseNetron.Why is the extracted subgraph different from the original subgraph?onnigiri applyonnx-simplifierbefore extraction. You can disable the graph optimization by the onnx-simplifier using the--no-optimizationoption.Development Guide$ poetry installBuild docker image$ nix build '.#dockerimage' -o image
$ docker load < ./imageRelated projectonnion
Package: onnion
onnionInstallationFromPyPI:$ pip3 install onnionFromDockerhub:docker pull idein/onnion:20221014Usage$ onnion ssd-10-post.onnx -o ssd_post_model.py
$ python
>>> from ssd_post_model import init_graph
>>> graph = init_graph()
>>> inputs = ... # List[np.array]
>>> outputs = graph.run(*inputs)With docker:$ docker run --rm -it -u $UID:$GID -v $(pwd):/work idein/onnion:20221014 ssd-10-post.onnx -o ssd_post_model.pyThe order of the inputs and the outputs in therunmethod corresponds to the order of the inputs and the outputs in the onnx graph.See alsotutorial.Development Guide$ poetry install
Package: onnion-rt
onnion-rtNote: This software includesthe workthat is distributed in theApache License 2.0.Installation$ pip3 install onnion-rtUsageSeetutorial.Development Guide$ poetry installHow to support new operatorsAddonnion_runtime/xxx.pyAn onnx operatorXxxmust correspond to a classXxx.A classXxxmust implement__init__andrunmethods.The parameters of the__init__methods must beself,opset_version, andkwargs.The attributes of the operator must be passed through thekwargsof the__init__method.Get the required attributes bykwargs['attr_name'].Get the optional attributes bykwargs.get('attr_name', default_value).The inputs of the operator must be passed through the arguments of therunmethod.Therunmethod must return the list ofnp.array.Addfrom .xxx import Xxx # noqa: F401toonnion_runtime/__init__.pyUpdate "Supported Operators" inREADME.mdAddtests/test_xxx.pyRun testspoetry run pytest -vFormat and lintpoetry run pysen run format && poetry run pysen run lintSupported OperatorsThis runtime supports only below operators.AbsAcosAcoshAddmust be from opsetversion >= 7Andmust be from opsetversion >= 7ArgMaxArgMinAsinAsinhAtanAtanhBatchNormalizationmust be from opsetversion >= 9BitShiftCastmust be from opsetversion >= 6CeilCeluClipCompressConcatConcatFromSequenceConstantConstantOfShapeConvTransposesupport 2d onlygroupshould be 1auto_padshould be"NOTSET"(default value)CosCoshDepthToSpaceDequantizeLinearDetDivmust be from opsetversion >= 7DropoutDynamicQuantizeLinearEinsumEluEqualmust be from opsetversion >= 7ErfExpExpandEyeLikeFlattenFloorGatherGatherElementsGahterNDGemmmust be from opsetversion >= 7GlobalAveragePoolGlobalMaxPoolGreatermust be from opsetversion >= 7GreaterOrEqualHardSigmoidHardSwishHardmaxIdentityIfInstanceNormalizationIsInfIsNaNLeakyReluLessmust be from opsetversion >= 7LessOrEqualLogLogSoftmaxLoopMatMulMatMulIntegerMaxMeanMinModMulmust be from opsetversion >= 7NegNegativeLogLikelihoodLossNonMaxSuppressionNonZeroNotOneHotOrmust be from opsetversion >= 7PReluPadPowmust be from opsetversion >= 7RandomNormalRandomNormalLikeRandomUniformRandomUniformLikeRangeReciprocalReduceL1ReduceL2ReduceLogSumReduceLogSumExpReduceMaxReduceMeanReduceMinReduceProdReduceSumReduceSumSquareReluReshapeRoundScatterNDShapeSigmoidSliceSoftmaxSplitargumentsplitmust be specifiedSqrtSqueezeSubmust be from opsetversion >= 7Tilemust be from opsetversion >= 6TopKTransposeUnsqueezeWhere
Package: onnpdf
OzNetNerd PDFConvenience Python module for creating templated PDF documents usingJinja2andWeasyPrint.Installationpip3 install onnpdfUsagePass a dictionary intoonnpdf, and it will:Perform a "find and replace" operation (as well as other Jinja2 operations defined in your template)Convert the template into a PDF documentExample dictionary as seen incode snippets:kv_pairs = {
    'title': 'OzNetNerd.com Demo PDF',
    'author': 'Will Robinson',
    'job_title': 'DevOps Specialist',
    'company': 'OzNetNerd.com',
    'email': 'will@oznetnerd.com',
    'phone': '+61 00 000 000',
    'website': 'https://oznetnerd.com'
}Example DocumentThe above producesthis PDF document.Example Use CaseAutomate the creation of personalised lab guides for users.This enables lab admins to easily provide users with unique usernames, passwords, DNS entries, etc.ContactBlog:oznetnerd.comEmail:will@oznetnerd.com
Package: onnx2json
onnx2jsonExports the ONNX file to a JSON file and JSON dict. Click here forjson2onnx.https://github.com/PINTO0309/simple-onnx-processing-tools1. Setup1-1. HostPC### option$echoexportPATH="~/.local/bin:$PATH">>~/.bashrc\&&source~/.bashrc### run$pipinstall-Uonnxprotobuf\&&python3-mpipinstall-Uonnx_graphsurgeon--index-urlhttps://pypi.ngc.nvidia.com\&&pipinstall-Uonnx2json1-2. Dockerhttps://github.com/PINTO0309/simple-onnx-processing-tools#docker2. CLI Usageusage:
  onnx2json [-h]
  -if INPUT_ONNX_FILE_PATH
  -oj OUTPUT_JSON_PATH
  [-i JSON_INDENT]

optional arguments:
  -h, --help
      show this help message and exit

  -if INPUT_ONNX_FILE_PATH, --input_onnx_file_path INPUT_ONNX_FILE_PATH
      Input ONNX model path. (*.onnx)

  -oj OUTPUT_JSON_PATH, --output_json_path OUTPUT_JSON_PATH
      Output JSON file path (*.json) If not specified, no JSON file is output.

  -i JSON_INDENT, --json_indent JSON_INDENT
      Number of indentations in JSON. (default=2)3. In-script Usage>>>fromonnx2jsonimportconvert>>>help(convert)Helponfunctionconvertinmoduleonnx2json.onnx2json:convert(input_onnx_file_path:Union[str,NoneType]='',onnx_graph:Union[onnx.onnx_ml_pb2.ModelProto,NoneType]=None,output_json_path:Union[str,NoneType]='',json_indent:Union[int,NoneType]=2)Parameters----------input_onnx_file_path:Optional[str]Inputonnxfilepath.Eitherinput_onnx_file_pathoronnx_graphmustbespecified.Default:''onnx_graph:Optional[onnx.ModelProto]onnx.ModelProto.Eitherinput_onnx_file_pathoronnx_graphmustbespecified.onnx_graphIfspecified,ignoreinput_onnx_file_pathandprocessonnx_graph.output_json_path:Optional[str]OutputJSONfilepath(*.json)Ifnotspecified,noJSONfileisoutput.Default:''json_indent:Optional[int]NumberofindentationsinJSON.Default:2Returns-------onnx_json:dictConvertedJSONdict.4. CLI Execution$onnx2json\--input_onnx_file_pathNonMaxSuppression.onnx\--output_json_pathNonMaxSuppression.json\--json_indent25. In-script Executionfromonnx2jsonimportconvertonnx_json=convert(input_onnx_file_path="NonMaxSuppression.onnx",output_json_path="NonMaxSuppression.json",json_indent=2,)# oronnx_json=convert(onnx_graph=graph,)6. Issueshttps://github.com/PINTO0309/simple-onnx-processing-tools/issues
Package: onnx2pytorch
ONNX to PyTorchA library to transform ONNX model to PyTorch. This library enables use of PyTorch
backend and all of its great features for manipulation of neural networks.Installationpip install onnx2pytorchUsageimport onnx
from onnx2pytorch import ConvertModel

onnx_model = onnx.load(path_to_onnx_model)
pytorch_model = ConvertModel(onnx_model)Currently supported and tested models fromonnx_zoo:MobileNetResNetShuffleNet_V2BERT-SquadEfficientNet-Lite4Fast Neural Style TransferSuper ResolutionYOLOv4(Not exactly the same, nearest neighbour interpolation in pytorch differs)U-net(Converted from pytorch to onnx and then back)LimitationsKnown current version limitations are:batch_size > 1could deliver unexpected results due to ambiguity of onnx's BatchNorm layer.That is why in this case for now we raise an assertion error.Setexperimental=TrueinConvertModelto be able to usebatch_size > 1.Fine tuning and training of converted models was not tested yet, only inference.DevelopmentDependency installationpip install -r requirements.txtFrom onnxruntime>=1.5.0 you need to add the
following to your .bashrc or .zshrc if you are running OSx:export KMP_DUPLICATE_LIB_OK=TrueCode formattingThe Uncompromising Code Formatter:Blackblack {source_file_or_directory}Install it into pre-commit hook to always commit nicely formatted code:pre-commit installTestingPytestandtox.toxTest fixturesTo test the complete conversion of an onnx model download pre-trained models:./download_fixtures.shUse flag--allto download more models.
Add any custom models to./fixturesfolder to test their conversion.DebuggingSetConvertModel(..., debug=True)to compare each converted
activation from pytorch with the activation from onnxruntime.This helps identify where in the graph the activations start to differ.
Package: onnx-array-api
onnx-array-apiimplements APIs to create custom ONNX graphs.
The objective is to speed up the implementation of converter libraries.
The first one matchesnumpy API.
It gives the user the ability to convert functions written
following the numpy API to convert that function into ONNX as
well as to execute it.importnumpyasnpfromonnx_array_api.npximportabsolute,jit_onnxfromonnx_array_api.plotting.text_plotimportonnx_simple_text_plotdefl1_loss(x,y):returnabsolute(x-y).sum()defl2_loss(x,y):return((x-y)**2).sum()defmyloss(x,y):returnl1_loss(x[:,0],y[:,0])+l2_loss(x[:,1],y[:,1])jitted_myloss=jit_onnx(myloss)x=np.array([[0.1,0.2],[0.3,0.4]],dtype=np.float32)y=np.array([[0.11,0.22],[0.33,0.44]],dtype=np.float32)res=jitted_myloss(x,y)print(res)print(onnx_simple_text_plot(jitted_myloss.get_onnx()))[0.042]
opset: domain='' version=18
input: name='x0' type=dtype('float32') shape=['', '']
input: name='x1' type=dtype('float32') shape=['', '']
Sub(x0, x1) -> r__0
  Abs(r__0) -> r__1
    ReduceSum(r__1, keepdims=0) -> r__2
output: name='r__2' type=dtype('float32') shape=NoneIt supports eager mode as well:importnumpyasnpfromonnx_array_api.npximportabsolute,eager_onnxdefl1_loss(x,y):err=absolute(x-y).sum()print(f"l1_loss={err.numpy()}")returnerrdefl2_loss(x,y):err=((x-y)**2).sum()print(f"l2_loss={err.numpy()}")returnerrdefmyloss(x,y):returnl1_loss(x[:,0],y[:,0])+l2_loss(x[:,1],y[:,1])eager_myloss=eager_onnx(myloss)x=np.array([[0.1,0.2],[0.3,0.4]],dtype=np.float32)y=np.array([[0.11,0.22],[0.33,0.44]],dtype=np.float32)res=eager_myloss(x,y)print(res)l1_loss=[0.04]
l2_loss=[0.002]
[0.042]The second API orLight APItends to do every thing in one line.
The euclidean distance looks like the following:import numpy as np
from onnx_array_api.light_api import start
from onnx_array_api.plotting.text_plot import onnx_simple_text_plot

model = (
    start()
    .vin("X")
    .vin("Y")
    .bring("X", "Y")
    .Sub()
    .rename("dxy")
    .cst(np.array([2], dtype=np.int64), "two")
    .bring("dxy", "two")
    .Pow()
    .ReduceSum()
    .rename("Z")
    .vout()
    .to_onnx()
)The library is released onpypi/onnx-array-apiand its documentation is published atAPIs to create ONNX Graphs.
Package: onnx-chainer
ONNX-ChainerAll code and functionalities of ONNX-Chainer have been merged intoChainerv7rc1 and this repository supports only bug fixes.This is an add-on package for ONNX support by Chainer.Tested environmentseeTested environmentsInstallationpipinstallonnx-chainerRun Test1. Install test modules$pipinstallonnx-chainer[test-cpu]Or, on GPU environment$pipinstallcupy# or cupy-cudaXX is useful$pipinstallonnx-chainer[test-gpu]2. Run tests$pytest-m"not gpu"Or, on GPU environment$pytestQuick StartFirst, installChainerCVto get the pre-trained models.importnumpyasnpimportchainerimportchainercv.linksasCimportonnx_chainermodel=C.VGG16(pretrained_model='imagenet')# Pseudo inputx=np.zeros((1,3,224,224),dtype=np.float32)onnx_chainer.export(model,x,filename='vgg16.onnx')Supported FunctionsseeSupported FunctionsContributionAny contribution to ONNX-Chainer is welcome!Python codes followChainer Coding Guidelines
Package: onnx_clip
onnx_clipAnONNX-based implementation ofCLIPthat doesn't
depend ontorchortorchvision.
It also has a friendlier API than the original implementation.This works byrunning the text and vision encoders (the ViT-B/32 variant) inONNX Runtimeusing a pure NumPy version of the tokenizerusing a pure NumPy+PIL version of thepreprocess function.
The PIL dependency could also be removed with minimal code changes - seepreprocessor.py.InstallationTo install, run the following in the root of the repository:pipinstall.UsageAll you need to do is call theOnnxClipmodel class. An example:fromonnx_clipimportOnnxClip,softmax,get_similarity_scoresfromPILimportImageimages=[Image.open("onnx_clip/data/franz-kafka.jpg").convert("RGB")]texts=["a photo of a man","a photo of a woman"]# Your images/texts will get split into batches of this size before being# passed to CLIP, to limit memory usageonnx_model=OnnxClip(batch_size=16)# Unlike the original CLIP, there is no need to run tokenization/preprocessing# separately - simply run get_image_embeddings directly on PIL images/NumPy# arrays, and run get_text_embeddings directly on strings.image_embeddings=onnx_model.get_image_embeddings(images)text_embeddings=onnx_model.get_text_embeddings(texts)# To use the embeddings for zero-shot classification, you can use these two# functions. Here we run on a single image, but any number is supported.logits=get_similarity_scores(image_embeddings,text_embeddings)probabilities=softmax(logits)print("Logits:",logits)fortext,pinzip(texts,probabilities[0]):print(f"Probability that the image is '{text}':{p:.3f}")Building & developing from sourceNote: The following may give timeout errors due to the filesizes. If so, this can be fixed with poetry version 1.1.13 - seethis related issue.Install, run, build and publish with PoetryInstallPoetrycurl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -To setup the project and create a virtual environment run the following command from the project's root directory.poetry installTo build a source and wheel distribution of the library run the following command from the project's root directory.poetry buildPublishing a new version to PyPI (for project maintainers)First, remove/move the downloaded LFS files, so that they're not packaged with the code.
Otherwise, this creates a huge.whlfile that PyPI refuses and it causes confusing errors.Then, followthis guide.
tl;dr: go to thePyPI account page, generate an API token
and put it into the$PYPI_PASSWORDenvironment variable. Then runpoetrypublish--build--usernamelakera--password$PYPI_PASSWORDHelpPlease let us know how we can support you:earlyaccess@lakera.ai.LICENSESee theLICENSEfile in this repository.Thefranz-kafka.jpgis taken fromhere.
Package: onnx-connx-neowine
ONNX to CONNX Converteronnx-connx is a tool which converts ONNX to CONNX model.
And onnx-connx is also a NumPy ONNX Runtime implementation for CONNX.
We don't recommend to use onnx-connx as an ONNX Runtime for NumPy is very (very) slow.For usersInstall onnx-connx via pippipinstallgit+https://github.com/semihlab/onnx-connxConvert ONNX to CONNX modelpython-monnx_connx--help# to get help messagepython-monnx_connx[onnxmodel]# to convert onnx to connxFor developersPrepare development environmentspython3onnx               # python package, to run onnx2connx converterprotobuf-compiler  # to run bin/dump utilitytabulate           # python package, to run test casespytest-parallel    # python package, to run test cases$sudoaptinstallpython3python3-pippython3-venv
$python3-mpipinstall--uservirtualenv
$python3-mvenvvenv
$sourcevenv/bin/activate
$pipinstall--upgradepip
$pipinstallonnxDebug installationpipinstallgit+file:///[path-to-onnx-connx]Dump onnx to textonnx-connx$bin/dump[onnxpath]# This utility will dump onnx or pb to text using protocTestRun testonnx-connx$maketestConvert all test cases that connx supportsonnx-connx$makeconvert-test[ONNX_HOME=[onnxinstalldir]][CONNX_HOME=[connxsourcedir]]# ONNX_HOME and CONNX_HOME can be omittedConvert individual test caseonnx-connx$bin/convert[onnxtestcasepath][connxtestcasepath]Run connx backendconnx backend will compile the ONNX to CONNX and run it using NumPy operators.python-monnx_connx.backend[onnxmodel][[inputtensor]...]Run MNIST exampleonnx-connx$cdexamples
onnx-connx/examples$./download.sh
onnx-connx/examples$cd..
onnx-connx$python-monnx_connx.backendexamples/mnist/model.onnxexamples/mnist/input_0.pbContributionSeeCONTRIBUTING.mdLicenseCONNX is licensed under GPLv3. SeeLICENSE
Package: onnxconverter-common
LinuxWindowsIntroductionThe onnxconverter-common package provides common functions and utilities for use in converters from various AI frameworks to ONNX. It also enables the different converters to work together to convert a model from mixed frameworks, like a scikit-learn pipeline embedding a xgboost model.LicenseMIT LicenseContributingThis project welcomes contributions and suggestions.  Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visithttps://cla.microsoft.com.When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.This project has adopted theMicrosoft Open Source Code of Conduct.
For more information see theCode of Conduct FAQor
contactopencode@microsoft.comwith any additional questions or comments.
Package: onnxcustom
onnxcustom: custom ONNXdocumentationExamples, tutorial on how to convert machine learned models into ONNX,
implement your own converter or runtime, or even train with ONNX / onnxruntime.The functioncheckor the command linepython-monnxcustom checkchecks the module is properly installed and returns processing
time for a couple of functions or simply:import onnxcustom
onnxcustom.check()The documentation also introducesonnx,onnxruntimefor
inference and training.
The tutorial related toscikit-learnhas been merged intosklearn-onnx documentation.
Among the tools this package implements, you may find:a tool to convert NVidia Profilder logs into a dataframe,a SGD optimizer similar to whatscikit-learnimplements but
based ononnxruntime-trainingand able to train an CPU and GPU,functions to manipulateonnxgraph.
Package: onnxcv
ONNXCVAlpha releaseWelcome to ONNXCVWelcome to OnnxCV! OnnxCV (OpenNeuralNetwork EXchange Runtime forComputerVision) is an inference engine for realtime computer vision, built uponONNX Runtimeand OpenCV.To learn more about ONNX, go to their Github repohereor their websitehere.
To learn more about OpenCV, go to their repohereor their websitehere.QuickstartInstall ONNXCV by invoking the following command in a terminal or command prompt:pip install onnxcvCreate a new directory and download theResNetmodel.
Copy and paste the following script in your code:fromonnxcvimportImageClassifierclf=ImageClassifier('resnet18v1.onnx')clf.run()To Do:Finish documentation (ETA: 1 day)
Package: onnx-donut
Onnx DonutPackage to export aDonutmodel from pytorch to ONNX, then run it with onnxruntime.Installationpipinstallonnx-donutExport to onnxfromonnx_donut.exporterimportexport_onnxfromonnx_donut.quantizerimportquantize# Hugging Face model card or foldermodel_path="naver-clova-ix/donut-base-finetuned-docvqa"# Folder where the exported model will be storeddst_folder="converted_donut"# Export from Pytorch to ONNXexport_onnx(model_path,dst_folder,opset_version=16)# Quantize your model to int8quantize(dst_folder,dst_folder+"_quant")Model inference with onnxruntimefromonnx_donut.predictorimportOnnxPredictorimportnumpyasnpfromPILimportImage# Image path to run onimg_path="/path/to/your/image.png"# Folder where the exported model will be storedonnx_folder="converted_donut"# Read imageimg=np.array(Image.open(img_path).convert('RGB'))# Instantiate ONNX predictorpredictor=OnnxPredictor(model_folder=onnx_folder,sess_options=options)# Write your prompt accordingly to the model you useprompt=f"<s_docvqa><s_question>what is the title?</s_question><s_answer>"# Run predictionout=predictor.generate(img,prompt)# Display predictionprint(out)
Package: onnx-hameln
ONNX model rewriter toola pure python tool to rewrite and optimize onnx modelusagefromonnx_hamelnimportHamelnModel,HPMm=HamelnModel("yolov5l_v3.onnx")HPM.rewrite(m)m.set_batch_size(32).set_nhwc_input_format().export("rewrite.onnx")
Package: onnxmodel-utils
onnxmodel-utilsutils for working with onnx modelsExampleSimple if modelfromonnxmodel_utilsimportModel,build_if_modelmodel1=Model.load('model1.onnx')model2=Model.load('model2.onnx')model=build_if_model("if_model","cond",model1,model2,)model.save('if_model.onnx')importonnxruntimesess=onnxruntime.InferenceSession('if_model.onnx')inps={"input":np.random.randn(1,3,224,224).astype(np.float32),"cond":np.array([True]).astype(np.bool),}out1=sess.run(None,inps)inps["cond"]=np.array([False]).astype(np.bool)out2=sess.run(None,inps)Optional cache modelfromonnxmodel_utilsimportModel,build_if_model_with_cachedecoder=Model.load("decoder.onnx")decoder_init=Model.load("decoder_init.onnx")model=build_if_model_with_cache(name="merged_model",cache_model=decoder,cacheless_model=decoder_init,cache_names=["pasts","pasts_st"],)model.save("merged_model.onnx")importonnxruntimeimportnumpyasnpsess=onnxruntime.InferenceSession("merged_model.onnx")inps={"input_ids":np.array([[1,2,3,4,5,6,7,8,9,10]],dtype=np.int64),"target_ids":np.array([[1,2,3,4,5,6,7,8,9,10]],dtype=np.int64),"pasts":None,"pasts_st":None,}init_out=sess.run(None,inps)inps["pasts"]=init_out[1]inps["pasts_st"]=init_out[2]out=sess.run(None,inps)Installationpipinstallonnxmodel-utils