You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a. it unnecessarily opens .npy file in the case tensor gets inlined.
b. it generates code as strings, not as AST
c. is it possible to make an injection by supplying an ONNX file with a rogue name?
A bundle is a directory with pickle-less
.npy
files and a python script__init__.py
binding them into a model.Feel free to reuse the approaches used in https://github.com/UniGrammar/UniGrammarRuntime.py/blob/master/UniGrammarRuntime/ParserBundle.py . It uses
urm
, which is a bit of overkill for your simple use case, so in your runtime you can just scan a dir fornpy
files and load them all into a dict.So the following tiny prolog is needed:
Also we can place there ONNX file, and dispatch in runtime whether to use the plain
numpy
impl or an accelerated one.Also the same
npy
files can be accessed, for example, from JS. Their format is damn simple and there are parsers.JS code can be generated using https://github.com/ksons/jscodegen.py from ESPrima AST (just a structure of
dict
s).But to be honest, there exists a project called
TVM
and IMHO the usual use case should be calling this project through TVM.So it is proposed to do the following:
The text was updated successfully, but these errors were encountered: