victor HF staff commited on
Commit
c32d95e
1 Parent(s): 2c26a0b
src/lib/components/Playground/Playground.svelte CHANGED
@@ -57,7 +57,7 @@
57
  let systemMessage: Message = { role: 'system', content: '' };
58
  $: messages = currentConversation.messages;
59
 
60
- let hfToken: string | null = '';
61
  let viewCode = false;
62
  let showTokenModal = false;
63
  let loading = false;
@@ -301,6 +301,7 @@
301
  submit();
302
  }}
303
  type="button"
 
304
  class="flex h-[39px] w-24 items-center justify-center gap-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 disabled:opacity-50 dark:border-gray-700 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-gray-700"
305
  >
306
  {#if loading}
 
57
  let systemMessage: Message = { role: 'system', content: '' };
58
  $: messages = currentConversation.messages;
59
 
60
+ let hfToken: string | null = import.meta.env.VITE_HF_TOKEN;
61
  let viewCode = false;
62
  let showTokenModal = false;
63
  let loading = false;
 
301
  submit();
302
  }}
303
  type="button"
304
+ disabled={loading}
305
  class="flex h-[39px] w-24 items-center justify-center gap-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 disabled:opacity-50 dark:border-gray-700 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-gray-700"
306
  >
307
  {#if loading}
src/lib/components/Playground/PlaygroundMessage.svelte CHANGED
@@ -13,16 +13,16 @@
13
  </script>
14
 
15
  <div
16
- class="@2xl:grid-cols-[130px,1fr,2.5rem] group/message @2xl:gap-4 @2xl:grid-rows-1 group grid grid-cols-[1fr,2.5rem] items-start gap-2 px-6 pb-6 pt-4 hover:bg-gray-50 dark:hover:bg-gray-800/50"
17
  >
18
- <div class="@2xl:col-span-1 @2xl:pb-2 col-span-2 pb-1 pt-3 text-sm font-semibold uppercase">
19
  {message.role}
20
  </div>
21
  <textarea
22
  {autofocus}
23
  bind:value={message.content}
24
  placeholder="Enter {message.role} message"
25
- class="@2xl:px-3 resize-none rounded bg-transparent px-2 py-2.5 ring-gray-100 [field-sizing:content] hover:resize-y hover:bg-white focus:resize-y focus:bg-white focus:ring group-hover/message:ring dark:ring-gray-600 dark:hover:bg-gray-900 dark:focus:bg-gray-900"
26
  rows="1"
27
  ></textarea>
28
  <button
 
13
  </script>
14
 
15
  <div
16
+ class="group/message group grid grid-cols-[1fr,2.5rem] items-start gap-2 px-6 pb-6 pt-4 hover:bg-gray-50 @2xl:grid-cols-[130px,1fr,2.5rem] @2xl:grid-rows-1 @2xl:gap-4 dark:hover:bg-gray-800/50"
17
  >
18
+ <div class="col-span-2 pb-1 pt-3 text-sm font-semibold uppercase @2xl:col-span-1 @2xl:pb-2">
19
  {message.role}
20
  </div>
21
  <textarea
22
  {autofocus}
23
  bind:value={message.content}
24
  placeholder="Enter {message.role} message"
25
+ class="resize-none rounded bg-transparent px-2 py-2.5 ring-gray-100 [field-sizing:content] hover:resize-y hover:bg-white focus:resize-y focus:bg-white focus:ring group-hover/message:ring @2xl:px-3 dark:ring-gray-600 dark:hover:bg-gray-900 dark:focus:bg-gray-900"
26
  rows="1"
27
  ></textarea>
28
  <button