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

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +92 -19
index.html CHANGED
@@ -2,28 +2,101 @@
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>Gemma Chatbot</title>
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <link rel="stylesheet" href="style.css">
10
  </head>
11
 
12
+ <body class="bg-gray-50">
13
+ <div class="flex flex-col h-screen">
14
+ <!-- Header -->
15
+ <header class="bg-white shadow-sm border-b border-gray-200">
16
+ <div class="max-w-4xl mx-auto px-4 py-4">
17
+ <div class="flex items-center justify-between">
18
+ <div class="flex items-center space-x-3">
19
+ <div
20
+ class="w-10 h-10 bg-gradient-to-br from-purple-500 to-pink-500 rounded-lg flex items-center justify-center">
21
+ <svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
22
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
23
+ d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z">
24
+ </path>
25
+ </svg>
26
+ </div>
27
+ <div>
28
+ <h1 class="text-xl font-semibold text-gray-900">Gemma Chatbot</h1>
29
+ <p class="text-sm text-gray-500">Powered by Transformers.js</p>
30
+ </div>
31
+ </div>
32
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank"
33
+ class="text-sm text-gray-500 hover:text-gray-700 transition-colors">
34
+ Built with anycoder ↗
35
+ </a>
36
+ </div>
37
+ </div>
38
+ </header>
39
+
40
+ <!-- Loading Screen -->
41
+ <div id="loadingScreen" class="flex-1 flex items-center justify-center bg-gray-50">
42
+ <div class="text-center">
43
+ <div class="inline-flex items-center justify-center w-16 h-16 mb-4">
44
+ <div class="animate-spin rounded-full h-12 w-12 border-b-2 border-purple-500"></div>
45
+ </div>
46
+ <h2 class="text-xl font-semibold text-gray-900 mb-2">Loading Model</h2>
47
+ <p class="text-gray-500 mb-4">Downloading Gemma model...</p>
48
+ <div class="w-64 bg-gray-200 rounded-full h-2 mx-auto">
49
+ <div id="progressBar" class="bg-purple-500 h-2 rounded-full transition-all duration-300" style="width: 0%">
50
+ </div>
51
+ </div>
52
+ <p id="progressText" class="text-sm text-gray-500 mt-2">0%</p>
53
+ </div>
54
+ </div>
55
+
56
+ <!-- Chat Container -->
57
+ <div id="chatContainer" class="flex-1 flex flex-col max-w-4xl w-full mx-auto hidden">
58
+ <!-- Messages Area -->
59
+ <div id="messagesArea" class="flex-1 overflow-y-auto p-4 space-y-4">
60
+ <!-- Welcome Message -->
61
+ <div class="flex items-start space-x-3">
62
+ <div
63
+ class="w-8 h-8 bg-gradient-to-br from-purple-500 to-pink-500 rounded-full flex items-center justify-center flex-shrink-0">
64
+ <svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
65
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
66
+ d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z">
67
+ </path>
68
+ </svg>
69
+ </div>
70
+ <div class="bg-white rounded-lg shadow-sm p-4 max-w-md">
71
+ <p class="text-gray-800">Hello! I'm Gemma, your AI assistant. How can I help you today?</p>
72
+ </div>
73
+ </div>
74
+ </div>
75
+
76
+ <!-- Input Area -->
77
+ <div class="border-t border-gray-200 bg-white p-4">
78
+ <div class="flex space-x-3">
79
+ <textarea
80
+ id="messageInput"
81
+ placeholder="Type your message here..."
82
+ class="flex-1 resize-none rounded-lg border border-gray-300 px-4 py-3 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
83
+ rows="1"
84
+ ></textarea>
85
+ <button
86
+ id="sendButton"
87
+ class="px-6 py-3 bg-gradient-to-r from-purple-500 to-pink-500 text-white rounded-lg hover:from-purple-600 hover:to-pink-600 transition-all duration-200 flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed"
88
+ >
89
+ <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
90
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"></path>
91
+ </svg>
92
+ </button>
93
+ </div>
94
+ <p class="text-xs text-gray-500 mt-2">Press Enter to send, Shift+Enter for new line</p>
95
+ </div>
96
+ </div>
97
+ </div>
98
 
99
+ <script src="index.js"></script>
100
  </body>
101
 
102
  </html>