akhaliq HF Staff commited on
Commit
a6ce108
·
verified ·
1 Parent(s): 196f698

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +89 -19
index.html CHANGED
@@ -2,28 +2,98 @@
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>
 
2
  <html lang="en">
3
 
4
  <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>AI Chatbot - Transformers.js</title>
8
+ <link rel="stylesheet" href="style.css">
 
9
  </head>
10
 
11
  <body>
12
+ <div class="container">
13
+ <header class="header">
14
+ <div class="header-content">
15
+ <h1>AI Chatbot</h1>
16
+ <p class="subtitle">Powered by Transformers.js</p>
17
+ </div>
18
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="built-with">Built with
19
+ anycoder</a>
20
+ </header>
21
+
22
+ <main class="main-content">
23
+ <div class="settings-panel">
24
+ <div class="setting-group">
25
+ <label for="model-select">Model:</label>
26
+ <select id="model-select">
27
+ <option value="Xenova/distilgpt2">DistilGPT2 (Fast)</option>
28
+ <option value="Xenova/gpt2">GPT2 (Balanced)</option>
29
+ <option value="Xenova/gpt2-medium">GPT2 Medium (Better)</option>
30
+ </select>
31
+ </div>
32
+ <div class="setting-group">
33
+ <label for="device-select">Device:</label>
34
+ <select id="device-select">
35
+ <option value="wasm">CPU (WebAssembly)</option>
36
+ <option value="webgpu">GPU (WebGPU)</option>
37
+ </select>
38
+ </div>
39
+ <button id="clear-chat" class="clear-btn">Clear Chat</button>
40
+ </div>
41
+
42
+ <div class="chat-container">
43
+ <div id="messages" class="messages">
44
+ <div class="message bot-message">
45
+ <div class="message-content">
46
+ <p>Hello! I'm your AI assistant. How can I help you today?</p>
47
+ </div>
48
+ <div class="message-time">Bot</div>
49
+ </div>
50
+ </div>
51
+ <div id="typing-indicator" class="typing-indicator hidden">
52
+ <span></span>
53
+ <span></span>
54
+ <span></span>
55
+ </div>
56
+ </div>
57
+
58
+ <div class="input-container">
59
+ <div class="input-wrapper">
60
+ <textarea
61
+ id="message-input"
62
+ placeholder="Type your message here..."
63
+ rows="1"
64
+ maxlength="500"
65
+ ></textarea>
66
+ <button id="send-button" class="send-button" disabled>
67
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
68
+ <line x1="22" y1="2" x2="11" y2="13"></line>
69
+ <polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
70
+ </svg>
71
+ </button>
72
+ </div>
73
+ <div class="input-info">
74
+ <span id="char-count">0 / 500</span>
75
+ </div>
76
+ </div>
77
+ </main>
78
+
79
+ <div id="loading-overlay" class="loading-overlay hidden">
80
+ <div class="loading-content">
81
+ <div class="spinner"></div>
82
+ <p>Loading model...</p>
83
+ <p class="loading-subtitle">This may take a few moments</p>
84
+ </div>
85
+ </div>
86
+
87
+ <div id="error-toast" class="error-toast hidden">
88
+ <div class="error-content">
89
+ <span class="error-icon">!</span>
90
+ <span id="error-message">An error occurred</span>
91
+ <button id="dismiss-error" class="dismiss-btn">&times;</button>
92
+ </div>
93
+ </div>
94
+ </div>
95
+
96
+ <script type="module" src="index.js"></script>
97
  </body>
98
 
99
  </html>