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 lines154155156157158159160153 unmodified linesconst RE_HF_TOKEN = /\bhf_[a-zA-Z0-9]{34}\b/;if (RE_HF_TOKEN.test(submittedHfToken)) {hfToken = submittedHfToken;if(storeLocallyHfToken){localStorage.setItem(hfTokenLocalStorageKey, JSON.stringify(hfToken));}submit();153 unmodified lines154155156157158159160153 unmodified linesconst RE_HF_TOKEN = /\bhf_[a-zA-Z0-9]{34}\b/;if (RE_HF_TOKEN.test(submittedHfToken)) {hfToken = submittedHfToken;if (storeLocallyHfToken) {localStorage.setItem(hfTokenLocalStorageKey, JSON.stringify(hfToken));}submit();
49 unmodified lines5051525354555657156 unmodified lines21421521621721821922076 unmodified lines29729829930030130230330430530649 unmodified lineshttp: getHttpSnippets(conversation, tokenStr),};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"){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>{/if}<buttonclass="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"49 unmodified lines5051525354555657156 unmodified lines21421521621721821922076 unmodified lines29729829930030130230330430530649 unmodified lineshttp: getHttpSnippets(conversation, tokenStr),};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") {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>{/if}<buttonclass="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 lines97989910010110210310410510610710810911096 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">store locally <span class="text-gray-800 dark:text-gray-300">(using <ahref="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>96 unmodified lines97989910010110210310410510610710810911011111211311496 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">store locally <span class="text-gray-800 dark:text-gray-300">(using <ahref="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 lines6869707172737416 unmodified lines9192939495969767 unmodified lines{#each featuredModels as model}{@const [nameSpace, modelName] = model.id.split("/")}<buttonclass="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100 w-full"on:click={() => {dispatch("modelSelected", model.id);dispatch("close");16 unmodified lines{#each otherModels as model}{@const [nameSpace, modelName] = model.id.split("/")}<buttonclass="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100 w-full"on:click={() => {dispatch("modelSelected", model.id);dispatch("close");67 unmodified lines6869707172737416 unmodified lines9192939495969767 unmodified lines{#each featuredModels as model}{@const [nameSpace, modelName] = model.id.split("/")}<buttonclass="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("/")}<buttonclass="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