jbilcke-hf HF staff commited on
Commit
a49356e
β€’
1 Parent(s): d3759c5

fix for the form

Browse files
Files changed (3) hide show
  1. public/index.html +17 -10
  2. public/placeholder.html +1 -1
  3. src/index.mts +1 -1
public/index.html CHANGED
@@ -3,7 +3,7 @@
3
  <title>Webapp Factory 🏭</title>
4
  <link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" />
5
  <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
6
- <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script>
7
  <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.contentWindow.min.js"></script>
8
  </head>
9
  <body>
@@ -42,19 +42,26 @@
42
  class="btn disabled:text-stone-400"
43
  @click="open = true, prompt = promptDraft, state = state === 'stopped' ? 'loading' : 'stopped'"
44
  :class="promptDraft.length < minPromptSize ? 'btn-neutral' : state === 'stopped' ? 'btn-accent' : 'btn-warning'"
45
- :disabled="promptDraft.length < minPromptSize"
46
  >
47
  <span x-show="promptDraft.length < minPromptSize">Prompt too short to generate</span>
48
  <span x-show="promptDraft.length >= minPromptSize && state !== 'stopped'">Stop now</span>
49
  <span x-show="promptDraft.length >= minPromptSize && state === 'stopped'">Generate!</span>
50
  </button>
51
- <span class="py-3" x-show="state === 'loading'"
52
- >Waiting for the stream to begin (might take a few minutes)..</span
53
- >
54
- <span class="py-3" x-show="state === 'streaming'">
55
- Streamed <span x-text="humanFileSize(size, true, 2)"></span> so far..<br />Note: this version generates up
56
- to 1200 tokens.</span
57
- >
 
 
 
 
 
 
 
 
58
  </div>
59
  </div>
60
  </div>
@@ -112,7 +119,7 @@
112
  // "page about dolphins": "a page about dolphins, with text and a few pictures"
113
  },
114
  promptDraft:
115
- new URLSearchParams(window.location.search).get("prompt"),
116
  prompt: "",
117
  size: 0,
118
  minPromptSize: 16, // if you change this, you will need to also change in src/index.mts
 
3
  <title>Webapp Factory 🏭</title>
4
  <link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" />
5
  <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
6
+ <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script>
7
  <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.contentWindow.min.js"></script>
8
  </head>
9
  <body>
 
42
  class="btn disabled:text-stone-400"
43
  @click="open = true, prompt = promptDraft, state = state === 'stopped' ? 'loading' : 'stopped'"
44
  :class="promptDraft.length < minPromptSize ? 'btn-neutral' : state === 'stopped' ? 'btn-accent' : 'btn-warning'"
 
45
  >
46
  <span x-show="promptDraft.length < minPromptSize">Prompt too short to generate</span>
47
  <span x-show="promptDraft.length >= minPromptSize && state !== 'stopped'">Stop now</span>
48
  <span x-show="promptDraft.length >= minPromptSize && state === 'stopped'">Generate!</span>
49
  </button>
50
+ <div class="flex flex-col py-3 text-stone-700">
51
+ <p class="py-3 text-stone-700">
52
+ Model used:
53
+ <a href="https://huggingface.co/WizardLM/WizardCoder-15B-V1.0" class="underline" target="_blank">
54
+ WizardCoder-15B-1.0
55
+ </a>
56
+ </p>
57
+ <p class="py-3 text-stone-700" x-show="state === 'loading'">
58
+ Waiting for the stream to begin (might take a few minutes)..
59
+ </p>
60
+ <p class="py-3 text-stone-700" x-show="state === 'streaming'">
61
+ Streamed <span x-text="humanFileSize(size, true, 2)"></span> so far..<br />Note: this version generates up
62
+ to 1200 tokens.
63
+ </p>
64
+ </div>
65
  </div>
66
  </div>
67
  </div>
 
119
  // "page about dolphins": "a page about dolphins, with text and a few pictures"
120
  },
121
  promptDraft:
122
+ new URLSearchParams(window.location.search).get("prompt") || '',
123
  prompt: "",
124
  size: 0,
125
  minPromptSize: 16, // if you change this, you will need to also change in src/index.mts
public/placeholder.html CHANGED
@@ -2,7 +2,7 @@
2
  <head>
3
  <title>Nothing to show (yet)</title>
4
  <link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" />
5
- <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script>
6
  </head>
7
  <body>
8
  <div class="hero min-h-screen bg-stone-100">
 
2
  <head>
3
  <title>Nothing to show (yet)</title>
4
  <link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" />
5
+ <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script>
6
  </head>
7
  <body>
8
  <div class="hero min-h-screen bg-stone-100">
src/index.mts CHANGED
@@ -54,7 +54,7 @@ app.get('/app', async (req, res) => {
54
 
55
  pending.queue.push(id)
56
 
57
- const prefix = `<html><head><link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" /><script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script><script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script><title>Generated content</title><body>`
58
  res.write(prefix)
59
 
60
  req.on('close', function() {
 
54
 
55
  pending.queue.push(id)
56
 
57
+ const prefix = `<html><head><link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" /><script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script><script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script><title>Generated content</title><body>`
58
  res.write(prefix)
59
 
60
  req.on('close', function() {