Spaces:
Running
Running
Vaibhavs10
commited on
Commit
·
acf9557
1
Parent(s):
658a4b0
up.
Browse files- index.html +4 -3
index.html
CHANGED
@@ -108,6 +108,7 @@
|
|
108 |
|
109 |
<script type="module">
|
110 |
import { oauthLoginUrl, oauthHandleRedirectIfPresent } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm';
|
|
|
111 |
// DOM Elements
|
112 |
const loginBtn = document.getElementById('login-btn');
|
113 |
const logoutBtn = document.getElementById('logout-btn');
|
@@ -224,7 +225,7 @@
|
|
224 |
const token = localStorage.getItem('hf_token');
|
225 |
if (!token) throw new Error('No token found');
|
226 |
|
227 |
-
hfClient = new
|
228 |
|
229 |
// Update UI
|
230 |
loginBtn.classList.add('hidden');
|
@@ -265,7 +266,7 @@
|
|
265 |
|
266 |
// Initialize client if not already done
|
267 |
if (!hfClient) {
|
268 |
-
hfClient = new
|
269 |
}
|
270 |
|
271 |
const model = modelSelect.value;
|
@@ -373,7 +374,7 @@
|
|
373 |
localStorage.setItem('hf_token', token);
|
374 |
localStorage.setItem('hf_user', JSON.stringify(user));
|
375 |
currentUser = user;
|
376 |
-
hfClient = new
|
377 |
setupAuthenticatedUI();
|
378 |
if (messageCount === 0) {
|
379 |
addMessage('assistant', `Hello ${user.name}! How can I help you today?`);
|
|
|
108 |
|
109 |
<script type="module">
|
110 |
import { oauthLoginUrl, oauthHandleRedirectIfPresent } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm';
|
111 |
+
import { InferenceClient } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm';
|
112 |
// DOM Elements
|
113 |
const loginBtn = document.getElementById('login-btn');
|
114 |
const logoutBtn = document.getElementById('logout-btn');
|
|
|
225 |
const token = localStorage.getItem('hf_token');
|
226 |
if (!token) throw new Error('No token found');
|
227 |
|
228 |
+
hfClient = new InferenceClient(token);
|
229 |
|
230 |
// Update UI
|
231 |
loginBtn.classList.add('hidden');
|
|
|
266 |
|
267 |
// Initialize client if not already done
|
268 |
if (!hfClient) {
|
269 |
+
hfClient = new InferenceClient(token);
|
270 |
}
|
271 |
|
272 |
const model = modelSelect.value;
|
|
|
374 |
localStorage.setItem('hf_token', token);
|
375 |
localStorage.setItem('hf_user', JSON.stringify(user));
|
376 |
currentUser = user;
|
377 |
+
hfClient = new InferenceClient(token);
|
378 |
setupAuthenticatedUI();
|
379 |
if (messageCount === 0) {
|
380 |
addMessage('assistant', `Hello ${user.name}! How can I help you today?`);
|