Spaces:
Sleeping
Sleeping
File size: 1,104 Bytes
faca43f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
<script lang="ts">
import Modal from "$lib/components/Modal.svelte";
import { progress_writable, curr_model_writable, map_writable } from "./LoadingModalWritable.js";
const forceUpdate = async (_) => {};
let loadingMap = new Map<string, number>();
let pr = 1;
map_writable.subscribe((value) => {
const [model, percent] = value;
pr = Number(percent);
if (model.startsWith("onnx")) {
loadingMap.set(model, Math.floor(Number(percent)));
//console.log(loadingMap);
}
});
</script>
<Modal>
<div class="flex w-full flex-col gap-0 p-2">
<div class="flex items-start text-xl font-bold text-gray-800">
<h2>Loading the model...</h2>
<br />
</div>
<div class="flex items-start text-s text-gray-800">
<br>Please wait while we download the model. This has to be done only once.
</div>
<br />
{#await forceUpdate(pr) then _}
{#each [...loadingMap] as [key, value]}
<p class="text-s text-gray-800">{key}</p>
<div class="w3-light-grey">
<div class="w3-blue" style="width:{value}%">{value}%</div>
</div>
<br />
{/each}
{/await}
</div>
</Modal>
|