Spaces:
Running
Running
Update index.html
Browse files- index.html +60 -8
index.html
CHANGED
@@ -7,13 +7,65 @@
|
|
7 |
<link rel="stylesheet" href="style.css" />
|
8 |
</head>
|
9 |
<body>
|
10 |
-
<div class="
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
</body>
|
19 |
</html>
|
|
|
7 |
<link rel="stylesheet" href="style.css" />
|
8 |
</head>
|
9 |
<body>
|
10 |
+
<div class="flex flex-col md:flex-row" x-data="app()" x-init="init()">
|
11 |
+
<div class="hero md:h-screen bg-stone-100 transition-[width] delay-150 ease-in-out w-full md:w-6/6" :class="open ? 'w-full md:w-2/6' : 'w-full md:w-6/6'">
|
12 |
+
<div class="hero-content text-center">
|
13 |
+
<div class="flex flex-col w-full md:max-w-xl space-y-3 md:space-y-6">
|
14 |
+
<h1 class="font-bold text-stone-600 mb-1 md:mb-3 transition-all delay-150 ease-in-out text-2xl md:text-3xl lg:text-6xl" :class="open
|
15 |
+
? 'text-2xl md:text-3xl lg:text-4xl'
|
16 |
+
: 'text-2xl md:text-3xl lg:text-6xl'">
|
17 |
+
Webapp Factory 🏭
|
18 |
+
</h1>
|
19 |
+
<div class="py-1 md:py-2 space-y-2 md:space-y-3 text-stone-600 transition-all delay-150 ease-in-out text-lg lg:text-xl" :class="open
|
20 |
+
? 'text-lg lg:text-xl'
|
21 |
+
: 'text-lg lg:text-xl'">
|
22 |
+
<p>A space to generate tiny web apps.</p>
|
23 |
+
<p>In case of hallucination try generating again 🎲</p>
|
24 |
+
</div>
|
25 |
+
<textarea name="promptDraft" x-model="promptDraft" rows="10" placeholder="Describe your web app" class="input w-full rounded text-stone-800 bg-stone-50 border-2 border-stone-400 font-mono text-md md:text-lg h-24 md:h-48"></textarea>
|
26 |
+
<p class="py-1 md:py-2 text-stone-700 text-italic">
|
27 |
+
Examples:
|
28 |
+
|
29 |
+
<a href="/?prompt=a simple page to compute the BMI using metric units" class="text-bold underline">compute my BMI</a>,
|
30 |
+
<a href="/?prompt=app listing various types of savanna animals, with their photos" class="text-bold underline">photos of savanna animals</a>
|
31 |
+
</p>
|
32 |
+
<button class="btn disabled:text-stone-400 btn-neutral" @click="open = true, prompt = promptDraft, state = state === 'stopped' ? 'loading' : 'stopped', state === 'streaming' ? stopGeneration() : true" :class="promptDraft.length < minPromptSize ? 'btn-neutral' : state === 'stopped' ? 'btn-accent' : 'btn-warning'" :disabled="promptDraft.length < minPromptSize" disabled="disabled">
|
33 |
+
<span x-show="promptDraft.length < minPromptSize">Prompt too short to generate</span>
|
34 |
+
<span x-show="promptDraft.length >= minPromptSize && state !== 'stopped'" style="display: none;">Stop now</span>
|
35 |
+
<span x-show="promptDraft.length >= minPromptSize && state === 'stopped'" style="display: none;">Generate!</span>
|
36 |
+
</button>
|
37 |
+
<div class="flex flex-col text-stone-700 space-y-1 md:space-y-2">
|
38 |
+
<p class="text-stone-700">
|
39 |
+
Model used:
|
40 |
+
<a href="https://huggingface.co/WizardLM/WizardCoder-15B-V1.0" class="underline" target="_blank">
|
41 |
+
WizardCoder-15B-1.0
|
42 |
+
</a>
|
43 |
+
</p>
|
44 |
+
<p>Powered by 🤗 <a href="https://huggingface.co/inference-endpoints" class="underline" target="_blank">Inference Endpoints</a></p>
|
45 |
+
<p class="text-stone-700" x-show="state === 'loading'" style="display: none;">
|
46 |
+
Waiting for the stream to begin (might take a few minutes)..
|
47 |
+
</p>
|
48 |
+
<p class="text-stone-700" x-show="state === 'streaming'" style="display: none;">
|
49 |
+
Content size: <span x-text="humanFileSize(size, true, 2)">0 B</span>. This version generates up
|
50 |
+
to 1686 tokens.
|
51 |
+
</p>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
<div class="flex flex-col transition-[width] delay-150 ease-in-out md:h-screen w-full md:w-0" :class="open ? 'w-full md:w-4/6' : 'w-full md:w-0'">
|
57 |
+
<iframe id="iframe" class="border-none w-full md:min-h-screen" :src="!open
|
58 |
+
? '/placeholder.html'
|
59 |
+
: `/app?prompt=${encodeURIComponent(prompt)}`
|
60 |
+
" src="/placeholder.html"></iframe>
|
61 |
+
|
62 |
+
<div x-show="state !== 'stopped'" class="flex w-full -mt-20 items-end justify-center pointer-events-none" style="display: none;">
|
63 |
+
<div class="flex flex-row py-3 px-8 text-center bg-stone-200 text-stone-600 rounded-md shadow-md">
|
64 |
+
<div class="animate-bounce duration-150 mr-1">🤖</div>
|
65 |
+
<div>Generating your app..</div>
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
</body>
|
71 |
</html>
|