Add EP download progress bar to all samples#621
Conversation
Add download_and_register_eps (or language equivalent) to all sample applications that were missing it. This ensures execution providers are downloaded and registered before model loading, which is required for variants like NvTensorRTRTX to appear in the catalog. Changes across 33 files in 4 languages: - C# (4 tutorials): await mgr.DownloadAndRegisterEpsAsync() - Python (9 samples): manager.download_and_register_eps() - JavaScript/TypeScript (12 samples): await manager.downloadAndRegisterEps() - Rust (8 samples): manager.download_and_register_eps(None).await? Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All samples now show per-EP download progress with name and percentage, matching the pattern already in native-chat-completions samples. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the multi-language samples to display per–execution provider (EP) download progress (EP name + percent) while running download*AndRegisterEps*, aligning sample UX across C#, JS/TS, Python, and Rust.
Changes:
- Added per-EP progress callbacks to EP download/registration calls across all samples.
- Standardized console progress output formatting (carriage-return line with aligned EP name + percentage).
- Updated one JS Electron sample to serialize SDK initialization via an
initPromise.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/rust/tutorial-voice-to-text/src/main.rs | Adds per-EP download progress output before model usage. |
| samples/rust/tutorial-tool-calling/src/main.rs | Adds per-EP download progress output before model selection. |
| samples/rust/tutorial-document-summarizer/src/main.rs | Adds per-EP download progress output before catalog/model usage. |
| samples/rust/tutorial-chat-assistant/src/main.rs | Adds per-EP download progress output during initialization. |
| samples/rust/tool-calling-foundry-local/src/main.rs | Adds per-EP download progress output before model load. |
| samples/rust/native-chat-completions/src/main.rs | Adds per-EP download progress output during manager initialization. |
| samples/rust/foundry-local-webserver/src/main.rs | Adds per-EP download progress output before web service/model setup. |
| samples/rust/audio-transcription-example/src/main.rs | Adds per-EP download progress output before transcription flow. |
| samples/python/web-server/src/app.py | Adds per-EP download progress printing before model/web service usage. |
| samples/python/tutorial-voice-to-text/src/app.py | Adds per-EP download progress printing before transcription flow. |
| samples/python/tutorial-tool-calling/src/app.py | Adds per-EP download progress printing before model/tool flow. |
| samples/python/tutorial-document-summarizer/src/app.py | Adds per-EP download progress printing before summarization flow. |
| samples/python/tutorial-chat-assistant/src/app.py | Adds per-EP download progress printing before chat assistant flow. |
| samples/python/tool-calling/src/app.py | Adds per-EP download progress printing before tool calling flow. |
| samples/python/native-chat-completions/src/app.py | Adds per-EP download progress printing before chat completion flow. |
| samples/python/langchain-integration/src/app.py | Adds per-EP download progress printing before LangChain integration flow. |
| samples/python/audio-transcription/src/app.py | Adds per-EP download progress printing before transcription; adjusts nearby comment. |
| samples/js/web-server-example/app.js | Adds per-EP download progress output prior to model download/load. |
| samples/js/tutorial-voice-to-text/app.js | Adds per-EP download progress output prior to speech model workflow. |
| samples/js/tutorial-tool-calling/app.js | Adds per-EP download progress output prior to tool calling workflow. |
| samples/js/tutorial-document-summarizer/app.js | Adds per-EP download progress output prior to summarization workflow. |
| samples/js/tutorial-chat-assistant/app.js | Adds per-EP download progress output prior to chat assistant workflow. |
| samples/js/tool-calling-foundry-local/src/app.js | Adds per-EP download progress output prior to model setup. |
| samples/js/langchain-integration-example/app.js | Adds per-EP download progress output prior to model setup. |
| samples/js/electron-chat-application/main.js | Serializes SDK init via initPromise and adds per-EP progress output during init. |
| samples/js/copilot-sdk-foundry-local/src/tool-calling.ts | Adds per-EP download progress output before model download/load. |
| samples/js/copilot-sdk-foundry-local/src/app.ts | Adds per-EP download progress output before model download/load. |
| samples/js/chat-and-audio-foundry-local/src/app.js | Adds per-EP download progress output before multi-model setup. |
| samples/js/audio-transcription-example/app.js | Adds per-EP download progress output before transcription flow. |
| samples/cs/tutorial-voice-to-text/Program.cs | Adds per-EP download progress output before catalog/model usage. |
| samples/cs/tutorial-tool-calling/Program.cs | Adds per-EP download progress output before model setup. |
| samples/cs/tutorial-document-summarizer/Program.cs | Adds per-EP download progress output before summarization flow. |
| samples/cs/tutorial-chat-assistant/Program.cs | Adds per-EP download progress output before chat assistant flow. |
| samples/cs/tool-calling-foundry-local-web-server/Program.cs | Replaces spinner EP registration with per-EP progress output. |
| samples/cs/tool-calling-foundry-local-sdk/Program.cs | Replaces spinner EP registration with per-EP progress output. |
| samples/cs/model-management-example/Program.cs | Replaces spinner EP registration with per-EP progress output. |
| samples/cs/foundry-local-web-server/Program.cs | Replaces spinner EP registration with per-EP progress output. |
| samples/cs/audio-transcription-example/Program.cs | Replaces spinner EP registration with per-EP progress output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rust: closure passed to download_and_register_eps_with_progress requires Send + 'static. Move current_ep inside a block expression with move closure so it owns the state. Python: fix 'whisper modelfor' -> 'whisper model for' typo. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
31ef003 to
ec61417
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
samples/rust/tutorial-voice-to-text/src/main.rs:1
- Calling
.ok()on theflush()result silently discards any I/O error in a way that can look accidental. If the intent is to ignore flush failures in a sample, using an explicit discard (e.g., assigning to_) makes that intent clearer; alternatively, log the error once to stderr if you want troubleshooting hints without failing the sample.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…vel EP callbacks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All samples now show per-EP download progress with name and percentage, matching the pattern already in native-chat-completions samples.
Changes (38 files across 4 languages):
Each callback tracks the current EP name and displays a carriage-return progress line showing EP name (left-aligned 30 chars) and download percentage.