-
Notifications
You must be signed in to change notification settings - Fork 1k
[v4] suppress console.error while creating InferenceSession #1468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nico-martin
wants to merge
8
commits into
v4
Choose a base branch
from
v4-disable-warnings
base: v4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1300ab0
suppress console.error while creating InferenceSession
nico-martin 712230d
changed console suppress if not one of the misslieading errors
nico-martin ffe11a2
set default logSeverityLevel and also match the ONNX_WEB.env.logLevel
nico-martin 9c41c3e
indentation
nico-martin 0bf295f
small fix
nico-martin 7d7b770
some clean-up
nico-martin 6c0c0c0
Apply suggestions from code review
nico-martin dfaf024
added LOG_LEVELS to the top of the file
nico-martin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -241,6 +241,8 @@ async function getSession(pretrained_model_name_or_path, fileName, options, is_d | |
|
|
||
| // Overwrite `executionProviders` if not specified | ||
| session_options.executionProviders ??= executionProviders; | ||
| // Set `logSeverityLevel` to 4 (fatal) if not specified | ||
| session_options.logSeverityLevel ??= 4; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be good. From my testing, a value of 3 will hide but as you say in #1468 (comment), a value of 4 is necessary to hide everything else when running in browser. |
||
|
|
||
| // Overwrite `freeDimensionOverrides` if specified in config and not set in session options | ||
| const free_dimension_overrides = custom_config.free_dimension_overrides; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can move the
ONNX_WEB.env.logLevellogic to happen during init (similar to how we set default WASM paths (as a good default).This should hopefully minimize any session_options specific code a user would need to set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think it makes sense to set the
ONNX_WEB.env.logLevelhere where I create a new session. Als a transformers.js user I dont really care if the log is a "onnxruntime session log" or a "onnxruntime general log". All I want to do is to create a pipeline and then be able to set the logLevel.My solutions basically abstracts this decision away by only providing one setting and thats basically the settings that has always been available in the
session_options(although very view people actually used that setting in the past I guess).