File size: 5,750 Bytes
7952faf
d376ead
7952faf
 
 
 
d376ead
 
 
 
 
 
 
 
7952faf
 
 
d376ead
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7952faf
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html lang="hi">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Simple Stories Hindi 20M – In-Browser AI</title>
    <meta name="description" content="Run a 20M parameter Hindi language model entirely in your browser. No server, no API key. Powered by llama.cpp WebAssembly." />

    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap" rel="stylesheet" />

    <link rel="stylesheet" href="style.css" />
</head>

<body>
    <div class="app-layout">
        <!-- Header -->
        <header class="header">
            <div class="header-main">
                <h1 class="title">Simple Stories Hindi <span>20M</span></h1>
                <p class="subtitle">Runs 100% in your browser · No server · <a href="https://huggingface.co/SmallScale/Simple-Stories-Hindi-20M" target="_blank" rel="noopener">Model</a></p>
            </div>
            <div id="deviceBadge" class="badge idle">Ready</div>
        </header>

        <!-- Playground Workspace -->
        <main class="workspace">

            <!-- Prompt -->
            <section class="section">
                <div class="section-label-row">
                    <label for="promptInput" class="section-label">Prompt (हिंदी संकेत)</label>
                    <div class="sample-prompts">
                        <span class="sample-label">Try:</span>
                        <button class="sample-btn" data-prompt="एक समय की बात है, एक छोटी लड़की">लड़की की कहानी</button>
                        <button class="sample-btn" data-prompt="एक जंगल में जहाँ पेड़ों ने रहस्यों को फुसफुसाया">जंगल का रहस्य</button>
                        <button class="sample-btn" data-prompt="एक छोटे से गाँव में एक समझदार लड़का रहता था">गाँव का लड़का</button>
                    </div>
                </div>
                <textarea id="promptInput" rows="3" placeholder="कहानी की शुरुआत लिखें...">एक समय की बात है, एक छोटी लड़की</textarea>
            </section>

            <!-- Single control: Temperature -->
            <section class="controls-row">
                <div class="control-item">
                    <div class="control-header">
                        <label for="temperature">Creativity (रचनात्मकता)</label>
                        <span id="tempValue" class="val-tag">0.70</span>
                    </div>
                    <input type="range" id="temperature" min="0.0" max="1.2" step="0.05" value="0.70" />
                    <span class="control-subtext">Low = focused &nbsp;·&nbsp; High = creative</span>
                </div>
            </section>

            <!-- Action Bar -->
            <div class="action-bar">
                <div class="action-left">
                    <button id="generateBtn" class="btn btn-primary">
                        <span id="generateBtnText">Generate</span>
                    </button>
                    <button id="stopBtn" class="btn btn-secondary" disabled>Stop</button>
                </div>
                <div class="action-right">
                    <button id="copyBtn" class="btn btn-subtle">Copy</button>
                    <button id="clearBtn" class="btn btn-subtle">Clear</button>
                </div>
            </div>

            <!-- Output Box -->
            <section class="output-section">
                <div class="output-header">
                    <span class="section-label">Output (कहानी)</span>
                    <span id="statusText" class="status-text"></span>
                </div>

                <!-- Progress Overlay (shown during model download) -->
                <div id="progressOverlay" class="progress-overlay hidden">
                    <div class="progress-inner">
                        <div class="progress-icon"></div>
                        <div class="progress-label" id="progressLabel">Downloading model…</div>
                        <div class="progress-track">
                            <div class="progress-fill" id="progressFill"></div>
                        </div>
                        <div class="progress-pct" id="progressPct">0%</div>
                        <div class="progress-sub" id="progressSub">FP16 · 43 MB · first run only</div>
                    </div>
                </div>

                <div id="outputBox" class="output-box">
                    <span class="placeholder-text">आपकी कहानी यहाँ दिखाई देगी…</span>
                </div>

                <div class="stats-bar">
                    <span id="promptTokenMetric" class="stat"></span>
                    <span class="stat-sep">·</span>
                    <span id="generatedTokenMetric" class="stat"></span>
                    <span class="stat-sep">·</span>
                    <span id="speedMetric" class="stat"></span>
                    <span class="stat-sep">·</span>
                    <span id="timeMetric" class="stat"></span>
                </div>
            </section>
        </main>
    </div>

    <script src="index.js" type="module"></script>
</body>

</html>