Spaces:
Runtime error
Runtime error
proper open/close modal
Browse filesFiles changed (2)
39 unmodified lines40414243444546172 unmodified lines219220221222223224225226227228229230231232171 unmodified lines40440540639839939 unmodified lines let hfToken: string | null = import.meta.env.VITE_HF_TOKEN; let viewCode = false; let showTokenModal = false; let showModelPickerModal = true; let loading = false; let tokens = 0; let latency = 0;172 unmodified lines />{/if}
{#if showModelPickerModal} <ModelPickerModal {models} on:modelSelected={(e) => changeModel(e.detail)} on:close={(e) => (showModelPickerModal = false)} />{/if}
<!-- svelte-ignore a11y-no-static-element-interactions --><div class="w-dvh grid divide-gray-200 overflow-hidden bg-gray-100/50 max-md:divide-y md:h-dvh dark:[color-scheme:dark]171 unmodified lines </div> {/if}</div>
<ModelPickerModal {models} on:modelSelected={(e) => changeModel(e.detail)} />3 unmodified lines45678791011121314151617181920212223242526272810293031323334353637383 unmodified lines
export let models: ModelEntryWithTokenizer[];
let backdropEl: HTMLDivElement;
const dispatch = createEventDispatcher<{ modelSelected: string }>(); const dispatch = createEventDispatcher<{ modelSelected: string; close: void }>();
function handleKeydown(event: KeyboardEvent) { // close on ESC if (event.key === 'Escape') { event.preventDefault(); dispatch('close'); } }
function handleBackdropClick(event: MouseEvent) { if (window?.getSelection()?.toString()) { return; } if (event.target === backdropEl) { dispatch('close'); } }</script>
<div class="fixed inset-0 flex h-screen items-start justify-center bg-black/85 pt-32"><svelte:window on:keydown={handleKeydown} />
<div class="fixed inset-0 z-10 flex h-screen items-start justify-center bg-black/85 pt-32" bind:this={backdropEl} on:click|stopPropagation={handleBackdropClick}> <div class="flex w-full max-w-[600px] items-start justify-center p-10"> <div class="flex h-full w-full flex-col overflow-hidden rounded-lg border bg-white text-gray-900 shadow-md"src/lib/components/InferencePlayground/InferencePlayground.svelte+9-2
src/lib/components/InferencePlayground/InferencePlaygroundModelPickerModal.svelte+27-2