diff --git a/src/lib/assets/css/global.css b/src/lib/assets/css/global.css index 5cb16ed..0b26491 100644 --- a/src/lib/assets/css/global.css +++ b/src/lib/assets/css/global.css @@ -374,4 +374,29 @@ padding: 2px 4px 2px 4px; .group, .config label.extra { margin-bottom: 4px; } +} + +.run { + text-align: center; + margin-top: 1em; +} +.run button { + padding: 4px 16px; + background-color: var(--green); + border: 1px solid var(--green); + color: white; + display: inline-block; + margin: 10px; + cursor: pointer; + box-shadow: + var(--green) 0px 10px 20px -12px, + var(--green) 0px 18px 16px -18px; +} + +.run button:hover { + background-color: var(--pink); + border: 1px solid var(--pink); + box-shadow: + var(--pink) 0px 6px 12px -8px, + var(--pink) 0px 12px 10px -12px; } \ No newline at end of file diff --git a/src/lib/assets/js/utils.js b/src/lib/assets/js/utils.js index a620e7b..9f65a2f 100644 --- a/src/lib/assets/js/utils.js +++ b/src/lib/assets/js/utils.js @@ -1,4 +1,4 @@ -import { autoStore, numberOfRunsStore, backendsStore, dataTypesStore, modelTypesStore, modelsStore, testQueueStore, resultStore } from '../../store/store' +import { autoStore, numberOfRunsStore, backendsStore, dataTypesStore, modelTypesStore, modelsStore, testQueueStore, resultsStore } from '../../store/store' import { models } from '../../config'; import { goto } from '$app/navigation'; import { base } from '$app/paths'; @@ -26,7 +26,11 @@ export const getGpu = () => { } export const addResult = (result) => { - resultStore.update((arr) => [...arr, result]); + resultsStore.update((arr) => [...arr, result]); +} + +export const resetResult = () => { + resultsStore.update(() => []); } export const clearTestQueue = () => { @@ -49,6 +53,7 @@ export const resetStore = () => { modelTypesStore.update(() => []); modelsStore.update(() => []); testQueueStore.update(() => []); + resultsStore.update(() => []); } /** @@ -100,6 +105,14 @@ modelsStore.subscribe((value) => { selectedModels = value; }); +/** + * @type {string[]} + */ +let testQueue; +testQueueStore.subscribe((value) => { + testQueue = value; +}); + export const goTo = () => { if (selectedModels.length > 0 && selectedBackends.length > 0 && selectedDataTypes.length > 0 && selectedModelTypes.length > 0) { if (selectedBackends.length > 0 && selectedBackends.length <= 8) { @@ -127,8 +140,6 @@ export const goTo = () => { let model = selectedModels.toString(); let url; - console.log(location.href + ' ' + location.pathname) - if (location.pathname === '/' || location.pathname === '/web-ai-benchmark') { url = `${base}?modeltype=${modelType}&datatype=${dataType}&backend=${backend}&run=${numOfRuns}&model=${model}` } else { @@ -147,7 +158,7 @@ export const goTo = () => { } } -export const testQueue = () => { +export const updateTestQueue = () => { /** * @type {string[]} */ @@ -195,6 +206,11 @@ export const stringToArray = (value) => { return value; }; +export const filterTestQueue = (id) => { + let filteredTestQueue = testQueue.filter((testQueue) => testQueue.id !== id); + testQueueStore.update(() => filteredTestQueue); +} + export const urlToStoreHome = (urlSearchParams) => { if (urlSearchParams.size > 0) { let modelType = urlSearchParams.get('modeltype'); @@ -262,4 +278,6 @@ export const urlToStoreHome = (urlSearchParams) => { } } } -}; \ No newline at end of file +}; + +export const sleep = (time) => new Promise(resolve => setTimeout(resolve, time)); \ No newline at end of file diff --git a/src/lib/components/ConfigBackends.svelte b/src/lib/components/ConfigBackends.svelte index 04688f5..852a955 100644 --- a/src/lib/components/ConfigBackends.svelte +++ b/src/lib/components/ConfigBackends.svelte @@ -1,6 +1,6 @@ + +