Skip to content

Feat session import downloads - #931

Merged
cristian-tamblay merged 2 commits into
developfrom
feat/session-import-downloads
Oct 22, 2026
Merged

cristian-tamblay merged 2 commits into
developfrom
feat/session-import-downloads

Conversation

@Creylay

@Creylay Creylay commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

When a session imported from a .dashai file uses a model that must be downloaded first (e.g. a HuggingFace translator) and the installation does not have it, the import succeeded silently and the problem only showed up later, when training or retraining. Now the import reports which models (including nested components in a run's parameters) are not downloaded, split by whether their run arrived trained:

  • Trained runs: the trained model travels inside the file with everything it needs, so it predicts from that saved copy without any download. The download is only needed to retrain it, so the notice is informational.
  • Untrained runs (e.g. from a configuration-only export): they have no saved copy and need the download before training, so the notice offers a Download button.

A model missing for both kinds is listed only as untrained, since that is the blocking case.

The import UI was also reworked. Previously the modal closed as soon as a file was chosen, the only sign of a long import was a small spinner in the Sessions header, and the notices were snackbars that piled up and auto-closed before they could be read. Now the whole import happens in one modal: the trust warning, a progress state that cannot be dismissed while the request runs, and a result view with every notice that stays open until Got it. An import with nothing to report just shows the success snackbar.


Type of Change

Check all that apply like this [x]:

  • Backend change
  • Frontend change
  • CI / Workflow change
  • Build / Packaging change
  • Bug fix
  • Documentation

Changes (by file)

  • DashAI/back/session_package/load.py: new _missing_downloads, which checks every run's model and its nested components against REQUIRES_DOWNLOAD and the current download status. The import result now includes needs_download_trained and needs_download_untrained, each with name and a display_name in the requested language.
  • DashAI/back/api/api_v1/endpoints/model_sessions.py: the import endpoint reads Accept-Language and passes it on, so display names come in the app language.
    • importing: spinner and help text; cannot be closed with the X, Escape or a backdrop click;
    • result: success message, version warnings, untrained runs and download notices; the untrained notice has a Download button that starts the downloads and then shows "Downloading...";
    • error: the backend reason, shown in the modal instead of a snackbar.
  • DashAI/front/src/types/modelSession.ts: IMissingDownload and the two new fields of ISessionImportResult.
  • DashAI/front/src/utils/i18n/locales/{en,es,pt,de,zh}/models.json: download notices, progress text, "Session imported" title and "Got it".
  • docs/.../tutorials/Models/share-session.md (en, es): explains the download notices and why trained runs only need the download to retrain.
  • tests/back/api/test_session_package.py: missing downloads split by trained/untrained, already downloaded or download-free models not listed, and display names in the app language.
  • DashAI/front/src/components/models/ImportSessionButton.test.jsx: no-notice import shows only the snackbar, notices stay in the modal until dismissed, and the Download button downloads every untrained model.

Testing (optional)

  1. Export a session that uses a downloadable model you can remove locally (e.g. a HuggingFace translator), once with trained models and once configuration only.
  2. Delete the model's download from Available Models.
  3. Import the trained file: the modal shows a progress state, then says retraining needs the download. Prediction works without downloading.
  4. Import the configuration-only file: the modal offers Download, which starts the download.
  5. Import a session with no downloadable models: the modal closes and only the success snackbar appears.

@Creylay
Creylay added this pull request to stack #928 October 21, 2026 11:19
Base automatically changed from feat/session-export to develop October 21, 2026 19:02
@cristian-tamblay
cristian-tamblay force-pushed the feat/session-import-downloads branch from 679622b to b0b34fc Compare October 21, 2026 19:02
@cristian-tamblay
cristian-tamblay merged commit ca92fa2 into develop Oct 22, 2026
18 checks passed
@cristian-tamblay
cristian-tamblay deleted the feat/session-import-downloads branch October 22, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants