-
Notifications
You must be signed in to change notification settings - Fork 319
Auto-load model and run inference on WinUI app launch #622
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -78,8 +78,24 @@ private async Task InitializeAndRunDemoAsync() | |||||||||||||||
| EpCombo.SelectionChanged += EpCombo_SelectionChanged; | ||||||||||||||||
|
|
||||||||||||||||
| providerInfo.AppendLine("========================================"); | ||||||||||||||||
| providerInfo.AppendLine("Select an execution provider (and device if required) then click 'Load / Reload Model'."); | ||||||||||||||||
| providerInfo.AppendLine("Auto-loading model with default execution provider..."); | ||||||||||||||||
| ResultsText.Text = providerInfo.ToString(); | ||||||||||||||||
|
|
||||||||||||||||
| // Auto-load model and run inference on startup | ||||||||||||||||
| try | ||||||||||||||||
| { | ||||||||||||||||
| await LoadModelAsync(); | ||||||||||||||||
| if (_session != null) | ||||||||||||||||
|
Comment on lines
+84
to
+88
|
||||||||||||||||
| { | ||||||||||||||||
| await LoadAndRunDemoAsync(); | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
| catch (Exception ex) | ||||||||||||||||
| { | ||||||||||||||||
| ResultsText.Text = providerInfo.ToString() | ||||||||||||||||
| + $"\nAuto-load failed: {ex.Message}" | ||||||||||||||||
| + "\nSelect an execution provider and click 'Load / Reload Model' to retry."; | ||||||||||||||||
|
Comment on lines
+95
to
+97
|
||||||||||||||||
| ResultsText.Text = providerInfo.ToString() | |
| + $"\nAuto-load failed: {ex.Message}" | |
| + "\nSelect an execution provider and click 'Load / Reload Model' to retry."; | |
| var failureInfo = new StringBuilder(providerInfo.ToString()); | |
| failureInfo.AppendLine($"Auto-load failed: {ex.Message}"); | |
| failureInfo.AppendLine("Select an execution provider and click 'Load / Reload Model' to retry."); | |
| ResultsText.Text = failureInfo.ToString(); |
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.
The status text says "default execution provider", but the code path uses whatever EP is currently selected in
EpCombo(which is set to the first EP name after sorting inPopulateEpCombo). This may not be the actual/default EP and can mislead users. Consider changing the message to reflect the actual selected EP (e.g., includeEpCombo.SelectedItem) or use wording like "Auto-loading model with selected execution provider".