browserBackendLabel function

String browserBackendLabel(
  1. dynamic provenance,
  2. dynamic l10n
)

The build a provenance names, as the panel shows it: WebGPU with its build, or the CPU build.

Implementation

String browserBackendLabel(
  InferenceProvenance? provenance,
  AppLocalizations l10n,
) {
  if (provenance == null) return '';
  return provenance.onGpu
      ? '${l10n.aiBrowserBackendWebgpu} (${provenance.build})'
      : l10n.aiBrowserBackendCpu;
}