File size: 2,685 Bytes
ab9f226
dd1b723
 
 
0f2b742
 
 
 
dd1b723
 
 
0f2b742
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dd1b723
 
 
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
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Gemma Chat Assistant</title>
  <link rel="stylesheet" href="styles.css">
</head>

<body>
  <div class="container">
    <header>
      <h1>🤖 Gemma Chat Assistant</h1>
      <p class="subtitle">Powered by Gemma 270M - Running locally in your browser</p>
      <p class="attribution">Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder"
          target="_blank">anycoder</a></p>
    </header>

    <div class="status-bar" id="statusBar">
      <div class="status-content">
        <span id="statusText">Initializing...</span>
        <div class="progress-container" id="progressContainer" style="display: none;">
          <div class="progress-bar" id="progressBar"></div>
        </div>
      </div>
    </div>

    <div class="chat-container">
      <div class="messages" id="messagesContainer">
        <div class="message assistant">
          <div class="message-content">
            <strong>Assistant:</strong>
            <p>Hello! I'm your AI assistant powered by Gemma. How can I help you today?</p>
          </div>
        </div>
      </div>

      <div class="input-container">
        <textarea
                    id="userInput"
                    placeholder="Type your message here... (Press Enter to send, Shift+Enter for new line)"
                    rows="3"
                    disabled
                ></textarea>
        <button id="sendButton" disabled>
                    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                        <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>
                    </svg>
                    Send
                </button>
        <button id="clearButton" class="clear-btn">
                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                        <path d="M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"/>
                    </svg>
                    Clear
                </button>
      </div>
    </div>

    <div class="info-panel">
      <h3>💡 Tips:</h3>
      <ul>
        <li>First load may take 1-2 minutes to download the model (~270MB)</li>
        <li>The model runs entirely in your browser - no data is sent to servers</li>
        <li>Try asking questions, requesting creative writing, or coding help</li>
        <li>Press Enter to send, Shift+Enter for a new line</li>
      </ul>
    </div>
  </div>

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

</html>