VethaNarayananG commited on
Commit
df0ccf3
·
verified ·
1 Parent(s): 1b38145

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +20 -2
index.html CHANGED
@@ -16,11 +16,18 @@
16
  button, select { padding:10px 14px; border-radius:6px; border:none; background:#3b82f6; color:white; cursor:pointer; }
17
  button:hover { background:#2563eb; }
18
  #status { font-size:12px; color:#888; margin-top:6px; }
 
 
19
  </style>
20
  </head>
21
  <body>
22
  <h2>🧠 My Multimodal Assistant</h2>
23
 
 
 
 
 
 
24
  <div id="chat"></div>
25
 
26
  <div id="controls">
@@ -35,8 +42,15 @@
35
  <div id="status"></div>
36
 
37
  <script>
38
- // ⚠️ Paste a FRESH token here (fine-grained, "Inference" permission only)
39
- const HF_TOKEN = "hf_PASTE_YOUR_NEW_TOKEN_HERE";
 
 
 
 
 
 
 
40
 
41
  const chatBox = document.getElementById("chat");
42
  const statusBox = document.getElementById("status");
@@ -60,6 +74,10 @@
60
  }
61
 
62
  async function send() {
 
 
 
 
63
  const text = document.getElementById("userInput").value.trim();
64
  const file = document.getElementById("imageInput").files[0];
65
  const mode = document.getElementById("mode").value;
 
16
  button, select { padding:10px 14px; border-radius:6px; border:none; background:#3b82f6; color:white; cursor:pointer; }
17
  button:hover { background:#2563eb; }
18
  #status { font-size:12px; color:#888; margin-top:6px; }
19
+ #tokenBar { display:flex; gap:8px; margin-bottom:12px; }
20
+ #tokenInput { flex:1; padding:8px; border-radius:6px; border:1px solid #333; background:#1a1a1a; color:#eee; }
21
  </style>
22
  </head>
23
  <body>
24
  <h2>🧠 My Multimodal Assistant</h2>
25
 
26
+ <div id="tokenBar">
27
+ <input type="password" id="tokenInput" placeholder="Paste your HF token here (not saved, session only)">
28
+ <button onclick="saveToken()">Set Token</button>
29
+ </div>
30
+
31
  <div id="chat"></div>
32
 
33
  <div id="controls">
 
42
  <div id="status"></div>
43
 
44
  <script>
45
+ let HF_TOKEN = ""; // set at runtime, never committed to the file
46
+
47
+ function saveToken() {
48
+ HF_TOKEN = document.getElementById("tokenInput").value.trim();
49
+ document.getElementById("tokenInput").value = "";
50
+ document.getElementById("tokenInput").placeholder = HF_TOKEN
51
+ ? "✅ Token set for this session"
52
+ : "Paste your HF token here";
53
+ }
54
 
55
  const chatBox = document.getElementById("chat");
56
  const statusBox = document.getElementById("status");
 
74
  }
75
 
76
  async function send() {
77
+ if (!HF_TOKEN) {
78
+ alert("Please set your Hugging Face token first (top of the page).");
79
+ return;
80
+ }
81
  const text = document.getElementById("userInput").value.trim();
82
  const file = document.getElementById("imageInput").files[0];
83
  const mode = document.getElementById("mode").value;