akhaliq HF Staff commited on
Commit
de28ecd
·
verified ·
1 Parent(s): 3215ade

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +74 -20
index.html CHANGED
@@ -1,29 +1,83 @@
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
-
4
  <head>
5
- <meta charset="UTF-8" />
6
- <link rel="stylesheet" href="style.css" />
7
-
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <title>Transformers.js - Object Detection</title>
10
  </head>
11
-
12
  <body>
13
- <h1>Object Detection w/ 🤗 Transformers.js</h1>
14
- <label id="container" for="upload">
15
- <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
16
- <path fill="#000"
17
- d="M3.5 24.3a3 3 0 0 1-1.9-.8c-.5-.5-.8-1.2-.8-1.9V2.9c0-.7.3-1.3.8-1.9.6-.5 1.2-.7 2-.7h18.6c.7 0 1.3.2 1.9.7.5.6.7 1.2.7 2v18.6c0 .7-.2 1.4-.7 1.9a3 3 0 0 1-2 .8H3.6Zm0-2.7h18.7V2.9H3.5v18.7Zm2.7-2.7h13.3c.3 0 .5 0 .6-.3v-.7l-3.7-5a.6.6 0 0 0-.6-.2c-.2 0-.4 0-.5.3l-3.5 4.6-2.4-3.3a.6.6 0 0 0-.6-.3c-.2 0-.4.1-.5.3l-2.7 3.6c-.1.2-.2.4 0 .7.1.2.3.3.6.3Z">
18
- </path>
19
- </svg>
20
- Click to upload image
21
- <label id="example">(or try example)</label>
22
- </label>
23
- <label id="status">Loading model...</label>
24
- <input id="upload" type="file" accept="image/*" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  <script src="index.js" type="module"></script>
27
  </body>
28
-
29
  </html>
 
1
+ <!-- index.html content here -->
2
  <!DOCTYPE html>
3
  <html lang="en">
 
4
  <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>AI Chat Assistant</title>
8
+ <link rel="stylesheet" href="style.css">
9
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
10
  </head>
 
11
  <body>
12
+ <div class="app-container">
13
+ <header class="header">
14
+ <h1><i class="fas fa-robot"></i> AI Chat Assistant</h1>
15
+ <div class="device-selector">
16
+ <label for="device-select">Execution Device:</label>
17
+ <select id="device-select">
18
+ <option value="cpu">CPU (WASM)</option>
19
+ <option value="webgpu">GPU (WebGPU) - Experimental</option>
20
+ </select>
21
+ <button id="device-toggle" class="btn-secondary">
22
+ <i class="fas fa-microchip"></i> CPU
23
+ </button>
24
+ </div>
25
+ </header>
26
+
27
+ <main class="chat-container">
28
+ <div class="messages-container" id="messages-container" role="log" aria-live="polite">
29
+ <div class="welcome-message">
30
+ <div class="message assistant-message">
31
+ <div class="message-header">
32
+ <i class="fas fa-robot"></i>
33
+ <span class="message-author">AI Assistant</span>
34
+ <span class="message-time"></span>
35
+ </div>
36
+ <div class="message-content">
37
+ Hello! I'm your AI assistant powered by MobileLLM. How can I help you today? I can solve math problems, answer questions, and much more!
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+
43
+ <div class="input-container">
44
+ <div class="input-wrapper">
45
+ <textarea
46
+ id="message-input"
47
+ placeholder="Type your message here... (e.g., Solve x^2 - x - 6 = 0)"
48
+ rows="1"
49
+ aria-label="Type your message"
50
+ ></textarea>
51
+ <button id="send-button" class="send-button" aria-label="Send message">
52
+ <i class="fas fa-paper-plane"></i>
53
+ </button>
54
+ </div>
55
+ <div class="input-footer">
56
+ <small>Press Enter to send, Shift+Enter for new line</small>
57
+ </div>
58
+ </div>
59
+ </main>
60
+
61
+ <div class="loading-overlay" id="loading-overlay">
62
+ <div class="loading-spinner">
63
+ <i class="fas fa-spinner fa-spin"></i>
64
+ <p>AI is thinking...</p>
65
+ </div>
66
+ </div>
67
+
68
+ <div class="status-bar" id="status-bar">
69
+ <span id="status-text">Ready to chat</span>
70
+ <span id="model-status">Model: Loading...</span>
71
+ </div>
72
+ </div>
73
+
74
+ <!-- Transformers.js Import -->
75
+ <script type="module">
76
+ import { pipeline, TextStreamer } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.3';
77
+ window.pipeline = pipeline;
78
+ window.TextStreamer = TextStreamer;
79
+ </script>
80
 
81
  <script src="index.js" type="module"></script>
82
  </body>
 
83
  </html>