Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
machineuser commited on
Commit ·
e7f21e7
1
Parent(s): 62d2745
Sync widgets demo
Browse files25 unmodified lines26272829303132333435363738394041424344454647484950515210 unmodified lines636465666768697071727325 unmodified lines[LoadState.Error]: "⚠️ This model could not be loaded.",} as const;function getStatusReport(modelLoadInfo: ModelLoadInfo | undefined,statuses: Record<LoadState, string>,isAzure = false): string {if (!modelLoadInfo) {return "Model state unknown";}if (modelLoadInfo.compute_type === ComputeType.CPU && modelLoadInfo.state === LoadState.Loaded && !isAzure) {return `The model is loaded and running on <a class="hover:underline" href="https://huggingface.co/intel" target="_blank">Intel Xeon 3rd Gen Scalable CPU</a>`;}return statuses[modelLoadInfo.state];}function getComputeTypeMsg(): string {const computeType = modelLoadInfo?.compute_type ?? ComputeType.CPU;if (computeType === ComputeType.CPU) {return "Intel Xeon 3rd Gen Scalable cpu";}return computeType;}</script><div class="mt-2">10 unmodified lines</div><div class="border-dotter mx-2 flex flex-1 -translate-y-px border-b border-gray-100" /><div>{@html getStatusReport(modelLoadInfo, azureState, true)}</div></div>{:else if computeTime}Computation time on {getComputeTypeMsg()}: {computeTime}{:else if (model.inference === InferenceDisplayability.Yes || model.pipeline_tag === "reinforcement-learning") && !modelTooBig}{@html getStatusReport(modelLoadInfo, state)}{:else if model.inference === InferenceDisplayability.ExplicitOptOut}25 unmodified lines26272829303132333435363710 unmodified lines484950515253545556575825 unmodified lines[LoadState.Error]: "⚠️ This model could not be loaded.",} as const;function getStatusReport(modelLoadInfo: ModelLoadInfo | undefined, statuses: Record<LoadState, string>): string {if (!modelLoadInfo) {return "Model state unknown";}return statuses[modelLoadInfo.state];}</script><div class="mt-2">10 unmodified lines</div><div class="border-dotter mx-2 flex flex-1 -translate-y-px border-b border-gray-100" /><div>{@html getStatusReport(modelLoadInfo, azureState)}</div></div>{:else if computeTime}Computation time on {modelLoadInfo?.compute_type ?? ComputeType.CPU}: {computeTime}{:else if (model.inference === InferenceDisplayability.Yes || model.pipeline_tag === "reinforcement-learning") && !modelTooBig}{@html getStatusReport(modelLoadInfo, state)}{:else if model.inference === InferenceDisplayability.ExplicitOptOut}
packages/widgets/src/lib/components/InferenceWidget/shared/WidgetInfo/WidgetInfo.svelte+3-18