Use the file directly to create an OrtSession
This commit is contained in:
parent
28d165ad08
commit
836fb97598
1 changed files with 2 additions and 2 deletions
|
@ -31,8 +31,8 @@ class OnnxTextEncoder {
|
|||
..setSessionGraphOptimizationLevel(GraphOptimizationLevel.ortEnableAll);
|
||||
try {
|
||||
_logger.info("Loading text model");
|
||||
final bytes = File(args["textModelPath"]).readAsBytesSync();
|
||||
final session = OrtSession.fromBuffer(bytes, sessionOptions);
|
||||
final session =
|
||||
OrtSession.fromFile(File(args["textModelPath"]), sessionOptions);
|
||||
_logger.info('text model loaded');
|
||||
return session.address;
|
||||
} catch (e, s) {
|
||||
|
|
Loading…
Add table
Reference in a new issue