Spaces:
Runtime error
Runtime error
format
Browse filesFiles changed (4)
- src/lib/components/InferencePlayground/InferencePlayground.svelte+1-1
- src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte+7-7
- src/lib/components/InferencePlayground/InferencePlaygroundHFTokenModal.svelte+12-8
- src/lib/components/InferencePlayground/InferencePlaygroundModelSelectorModal.svelte+2-2
153 unmodified lines154155156157157158159160153 unmodified lines const RE_HF_TOKEN = /\bhf_[a-zA-Z0-9]{34}\b/; if (RE_HF_TOKEN.test(submittedHfToken)) { hfToken = submittedHfToken; if(storeLocallyHfToken){ if (storeLocallyHfToken) { localStorage.setItem(hfTokenLocalStorageKey, JSON.stringify(hfToken)); } submit();49 unmodified lines50515253545354555657156 unmodified lines21421521621721721821922076 unmodified lines29729829930030130230330030130230330430530649 unmodified lines http: getHttpSnippets(conversation, tokenStr), };
function getTokenStr(showToken: boolean){ if(hfToken && showToken){ function getTokenStr(showToken: boolean) { if (hfToken && showToken) { return hfToken; } return "YOUR_HF_TOKEN";156 unmodified lines }
function getHttpSnippets(conversation: Conversation, tokenStr: string) { if(tokenStr === "YOUR_HF_TOKEN"){ if (tokenStr === "YOUR_HF_TOKEN") { tokenStr = "{YOUR_HF_TOKEN}"; } const formattedMessages = ({ sep, start, end }: MessagesJoiner) =>76 unmodified lines <h2 class="font-semibold">{label}</h2> <div class="flex items-center gap-x-4"> {#if needsToken && hfToken} <label class="flex items-center gap-x-1.5"> <input type="checkbox" bind:checked={showToken}> <p class="leading-none">show token</p> </label> <label class="flex items-center gap-x-1.5"> <input type="checkbox" bind:checked={showToken} /> <p class="leading-none">show token</p> </label> {/if} <button class="flex items-center gap-x-1.5 rounded-md bg-gray-200 px-1.5 py-0.5 text-sm transition dark:bg-gray-950/80"96 unmodified lines97989910010110010110210310410510610710210310410510610710810911011111211311496 unmodified lines /> </div> <label class="flex items-center gap-x-1 text-gray-900 dark:text-gray-200"> <input type="checkbox" bind:checked={storeLocallyHfToken} /> <p class="leading-none"> <input type="checkbox" bind:checked={storeLocallyHfToken}> <p class="leading-none">store locally <span class="text-gray-800 dark:text-gray-300">(using <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank" class="underline" > localStorage </a> for the next use)</span></p> store locally <span class="text-gray-800 dark:text-gray-300" >(using <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank" class="underline" > localStorage </a> for the next use)</span > </p> </label> </div>
67 unmodified lines686970717172737416 unmodified lines919293949495969767 unmodified lines {#each featuredModels as model} {@const [nameSpace, modelName] = model.id.split("/")} <button class="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100 w-full" class="flex w-full cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100" on:click={() => { dispatch("modelSelected", model.id); dispatch("close");16 unmodified lines {#each otherModels as model} {@const [nameSpace, modelName] = model.id.split("/")} <button class="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100 w-full" class="flex w-full cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100" on:click={() => { dispatch("modelSelected", model.id); dispatch("close");src/lib/components/InferencePlayground/InferencePlayground.svelte+1-1
src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte+7-7
src/lib/components/InferencePlayground/InferencePlaygroundHFTokenModal.svelte+12-8
src/lib/components/InferencePlayground/InferencePlaygroundModelSelectorModal.svelte+2-2