Skip to content

Commit 549c752

Browse files
committed
format
1 parent 95431e3 commit 549c752

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

src/lib/components/InferencePlayground/InferencePlayground.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
const RE_HF_TOKEN = /\bhf_[a-zA-Z0-9]{34}\b/;
154154
if (RE_HF_TOKEN.test(submittedHfToken)) {
155155
hfToken = submittedHfToken;
156-
if(storeLocallyHfToken){
156+
if (storeLocallyHfToken) {
157157
localStorage.setItem(hfTokenLocalStorageKey, JSON.stringify(hfToken));
158158
}
159159
submit();

src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
http: getHttpSnippets(conversation, tokenStr),
5151
};
5252
53-
function getTokenStr(showToken: boolean){
54-
if(hfToken && showToken){
53+
function getTokenStr(showToken: boolean) {
54+
if (hfToken && showToken) {
5555
return hfToken;
5656
}
5757
return "YOUR_HF_TOKEN";
@@ -214,7 +214,7 @@ print(output.choices[0].message)`,
214214
}
215215
216216
function getHttpSnippets(conversation: Conversation, tokenStr: string) {
217-
if(tokenStr === "YOUR_HF_TOKEN"){
217+
if (tokenStr === "YOUR_HF_TOKEN") {
218218
tokenStr = "{YOUR_HF_TOKEN}";
219219
}
220220
const formattedMessages = ({ sep, start, end }: MessagesJoiner) =>
@@ -297,10 +297,10 @@ print(output.choices[0].message)`,
297297
<h2 class="font-semibold">{label}</h2>
298298
<div class="flex items-center gap-x-4">
299299
{#if needsToken && hfToken}
300-
<label class="flex items-center gap-x-1.5">
301-
<input type="checkbox" bind:checked={showToken}>
302-
<p class="leading-none">show token</p>
303-
</label>
300+
<label class="flex items-center gap-x-1.5">
301+
<input type="checkbox" bind:checked={showToken} />
302+
<p class="leading-none">show token</p>
303+
</label>
304304
{/if}
305305
<button
306306
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"

src/lib/components/InferencePlayground/InferencePlaygroundHFTokenModal.svelte

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,18 @@
9797
/>
9898
</div>
9999
<label class="flex items-center gap-x-1 text-gray-900 dark:text-gray-200">
100-
<input type="checkbox" bind:checked={storeLocallyHfToken}>
101-
<p class="leading-none">store locally <span class="text-gray-800 dark:text-gray-300">(using <a
102-
href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage"
103-
target="_blank"
104-
class="underline"
105-
>
106-
localStorage
107-
</a> for the next use)</span></p>
100+
<input type="checkbox" bind:checked={storeLocallyHfToken} />
101+
<p class="leading-none">
102+
store locally <span class="text-gray-800 dark:text-gray-300"
103+
>(using <a
104+
href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage"
105+
target="_blank"
106+
class="underline"
107+
>
108+
localStorage
109+
</a> for the next use)</span
110+
>
111+
</p>
108112
</label>
109113
</div>
110114

src/lib/components/InferencePlayground/InferencePlaygroundModelSelectorModal.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
{#each featuredModels as model}
6969
{@const [nameSpace, modelName] = model.id.split("/")}
7070
<button
71-
class="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100 w-full"
71+
class="flex w-full cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100"
7272
on:click={() => {
7373
dispatch("modelSelected", model.id);
7474
dispatch("close");
@@ -91,7 +91,7 @@
9191
{#each otherModels as model}
9292
{@const [nameSpace, modelName] = model.id.split("/")}
9393
<button
94-
class="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100 w-full"
94+
class="flex w-full cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100"
9595
on:click={() => {
9696
dispatch("modelSelected", model.id);
9797
dispatch("close");

0 commit comments

Comments
 (0)