mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
[js/rn] Fix some bugs (#20242)
### Description <!-- Describe your changes. --> - Fix `logSeverityLevel` - Correct get RCTCxxBridge, old method for some cases will got wrong bridge ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> --------- Co-authored-by: Yulong Wang <7679871+fs-eire@users.noreply.github.com>
This commit is contained in:
parent
87ed1e3e3f
commit
2a17958b34
2 changed files with 10 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ import ai.onnxruntime.OnnxTensor;
|
|||
import ai.onnxruntime.OnnxValue;
|
||||
import ai.onnxruntime.OrtEnvironment;
|
||||
import ai.onnxruntime.OrtException;
|
||||
import ai.onnxruntime.OrtLoggingLevel;
|
||||
import ai.onnxruntime.OrtSession;
|
||||
import ai.onnxruntime.OrtSession.Result;
|
||||
import ai.onnxruntime.OrtSession.RunOptions;
|
||||
|
|
@ -421,7 +422,7 @@ public class OnnxruntimeModule extends ReactContextBaseJavaModule implements Lif
|
|||
|
||||
if (options.hasKey("logSeverityLevel")) {
|
||||
int logSeverityLevel = options.getInt("logSeverityLevel");
|
||||
sessionOptions.setSessionLogVerbosityLevel(logSeverityLevel);
|
||||
sessionOptions.setSessionLogLevel(OrtLoggingLevel.mapFromInt(logSeverityLevel));
|
||||
}
|
||||
|
||||
return sessionOptions;
|
||||
|
|
@ -432,7 +433,7 @@ public class OnnxruntimeModule extends ReactContextBaseJavaModule implements Lif
|
|||
|
||||
if (options.hasKey("logSeverityLevel")) {
|
||||
int logSeverityLevel = options.getInt("logSeverityLevel");
|
||||
runOptions.setLogVerbosityLevel(logSeverityLevel);
|
||||
runOptions.setLogLevel(OrtLoggingLevel.mapFromInt(logSeverityLevel));
|
||||
}
|
||||
|
||||
if (options.hasKey("tag")) {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,16 @@
|
|||
|
||||
@implementation OnnxruntimeJSIHelper
|
||||
|
||||
@synthesize bridge = _bridge;
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (void)setBridge:(RCTBridge *)bridge {
|
||||
_bridge = bridge;
|
||||
}
|
||||
|
||||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) {
|
||||
RCTBridge *bridge = [RCTBridge currentBridge];
|
||||
RCTCxxBridge *cxxBridge = (RCTCxxBridge *)bridge;
|
||||
RCTCxxBridge *cxxBridge = (RCTCxxBridge *)_bridge;
|
||||
if (cxxBridge == nil) {
|
||||
return @false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue