Spaces:
Runtime error
Runtime error
token modal followup
Browse filesFiles changed (3)
144 unmodified lines14514614714814915015151 unmodified lines20320420520620720820914 unmodified lines224225226227228229230231144 unmodified lines<svelte:window on:keydown={onKeydown} />{#if showTokenModal}<PlaygroundTokenModal on:close={() => (showTokenModal = false)} />{/if}<div51 unmodified lines>Reset</button><div class="flex-1 items-center justify-center text-center text-sm text-gray-500">0 tokens · Latency {latency}ms</div><buttontype="button"14 unmodified lines{!viewCode ? 'View Code' : 'Hide Code'}</button><buttonon:click={submit}disabled={viewCode || loading}type="button"class="flex h-[42px] w-24 items-center justify-center rounded-lg bg-black px-5 py-2.5 text-sm font-medium text-white hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 disabled:opacity-50 dark:border-gray-700 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-gray-700">144 unmodified lines14514614714814915015115215315415515615715815951 unmodified lines21121221321421521621714 unmodified lines232233234235236237238239240241144 unmodified lines<svelte:window on:keydown={onKeydown} />{#if showTokenModal}<PlaygroundTokenModalon:close={() => (showTokenModal = false)}on:submit={(e) => {const formData = new FormData(e.target);hfToken = formData.get('hf-token');submit();showTokenModal = false;}}/>{/if}<div51 unmodified lines>Reset</button><div class="flex-1 items-center justify-center text-center text-sm text-gray-500"><span class="max-xl:hidden">0 tokens · Latency {latency}ms</span></div><buttontype="button"14 unmodified lines{!viewCode ? 'View Code' : 'Hide Code'}</button><buttonon:click={() => {viewCode = false;submit();}}type="button"class="flex h-[42px] w-24 items-center justify-center rounded-lg bg-black px-5 py-2.5 text-sm font-medium text-white hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 disabled:opacity-50 dark:border-gray-700 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-gray-700">
61 unmodified lines6263646566676869707172737461 unmodified lines<h2 class="font-semibold">Install and instantiate</h2></div><preclass="overflow-x-auto border-y border-y-gray-100 bg-gray-50 px-4 py-6 text-sm">{npmSnippet}</pre><div class="px-4 pb-4 pt-6"><h2 class="font-semibold">{streaming ? 'Streaming API' : 'Non-Streaming API'}</h2></div><pre class="overflow-x-auto border-y border-gray-100 bg-gray-50 px-4 py-6 text-sm">{streaming? streamingSnippet: nonStreamingSnippet}</pre>61 unmodified lines626364656667686970717273747561 unmodified lines<h2 class="font-semibold">Install and instantiate</h2></div><preclass="overflow-x-auto border-y border-gray-100 bg-gray-50 px-4 py-6 text-sm dark:border-gray-800 dark:bg-gray-800/50">{npmSnippet}</pre><div class="px-4 pb-4 pt-6"><h2 class="font-semibold">{streaming ? 'Streaming API' : 'Non-Streaming API'}</h2></div><preclass="overflow-x-auto border-y border-gray-100 bg-gray-50 px-4 py-6 text-sm dark:border-gray-800 dark:bg-gray-800/50">{streaming? streamingSnippet: nonStreamingSnippet}</pre>
41 unmodified lines424344454647482 unmodified lines51525354555657585960616 unmodified lines6869707172737418 unmodified lines9394959697989910010110210310410510612 unmodified lines11912012112212312412512612712812941 unmodified lines<!-- svelte-ignore a11y-no-noninteractive-element-interactions --><divid="default-modal"tabindex="-1"aria-hidden="true"class="fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-black/85"bind:this={backdropEl}2 unmodified lines<divrole="dialog"tabindex="-1"class="relative max-h-full w-full max-w-xl p-4"bind:this={modalEl}on:keydown={handleKeydown}><div class="relative rounded-lg bg-white shadow dark:bg-gray-700"><divclass="flex items-center justify-between rounded-t border-b p-4 md:p-5 dark:border-gray-600">6 unmodified linesclass="ms-auto inline-flex h-8 w-8 items-center justify-center rounded-lg bg-transparent text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white"><svgclass="h-3 w-3"aria-hidden="true"xmlns="http://www.w3.org/2000/svg"fill="none"18 unmodified lines><br /> Your token is kept safe by only being used from your browser.</p><div class="mb-6"><labelfor="default-input"class="mb-2 block text-sm font-medium text-gray-900 dark:text-white">Hugging Face Token</label><inputtype="text"id="default-input"class="block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"/></div>12 unmodified lines><buttontype="button"class="mb-2 me-2 rounded-lg bg-black px-5 py-2.5 text-sm font-medium text-white hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700">Submit</button></div></div></div></div>41 unmodified lines4243444546472 unmodified lines50515253545556575859606 unmodified lines6768697071727318 unmodified lines929394959697989910010110210310410510612 unmodified lines11912012112212312412512612712812941 unmodified lines<!-- svelte-ignore a11y-no-noninteractive-element-interactions --><divid="default-modal"aria-hidden="true"class="fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-black/85"bind:this={backdropEl}2 unmodified lines<divrole="dialog"tabindex="-1"class="relative max-h-full w-full max-w-xl p-4 outline-none"bind:this={modalEl}on:keydown={handleKeydown}><form on:submit|preventDefault class="relative rounded-lg bg-white shadow dark:bg-gray-900"><divclass="flex items-center justify-between rounded-t border-b p-4 md:p-5 dark:border-gray-600">6 unmodified linesclass="ms-auto inline-flex h-8 w-8 items-center justify-center rounded-lg bg-transparent text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white"><svgclass="size-3"aria-hidden="true"xmlns="http://www.w3.org/2000/svg"fill="none"18 unmodified lines><br /> Your token is kept safe by only being used from your browser.</p><div class="mb-6"><label for="hf-token" class="mb-2 block text-sm font-medium text-gray-900 dark:text-white">Hugging Face Token</label><inputrequiredplaceholder="Enter HF Token"type="text"id="hf-token"name="hf-token"class="block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"/></div>12 unmodified lines><buttontype="submit"class="mb-2 me-2 rounded-lg bg-black px-5 py-2.5 text-sm font-medium text-white hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700">Submit</button></div></form></div></div>
src/lib/components/Playground/Playground.svelte+14-4
src/lib/components/Playground/PlaygroundCode.svelte+3-2
src/lib/components/Playground/PlaygroundTokenModal.svelte+10-10