Spaces:
Running
Running
Update index.html
Browse files- index.html +4 -1
index.html
CHANGED
@@ -150,9 +150,12 @@
|
|
150 |
try {
|
151 |
// 1) Get IDs (no options arg!)
|
152 |
const enc = await tokenizer.encode(text);
|
|
|
|
|
153 |
// robustly pluck ids out of whatever shape the lib returns
|
154 |
let ids = (enc && (enc.ids ?? enc.input_ids ?? enc.inputIds)) || [];
|
155 |
-
|
|
|
156 |
// 2) Drop special tokens (e.g., BOS/EOS) for the demo
|
157 |
const specials = new Set(tokenizer.all_special_ids || []);
|
158 |
const idsNoSpecials = ids.filter(id => !specials.has(id));
|
|
|
150 |
try {
|
151 |
// 1) Get IDs (no options arg!)
|
152 |
const enc = await tokenizer.encode(text);
|
153 |
+
|
154 |
+
console.log('enc =', enc); // See what the tokenizer returns
|
155 |
// robustly pluck ids out of whatever shape the lib returns
|
156 |
let ids = (enc && (enc.ids ?? enc.input_ids ?? enc.inputIds)) || [];
|
157 |
+
console.log('ids=', ids, 'specials=', tokenizer.all_special_ids);
|
158 |
+
|
159 |
// 2) Drop special tokens (e.g., BOS/EOS) for the demo
|
160 |
const specials = new Set(tokenizer.all_special_ids || []);
|
161 |
const idsNoSpecials = ids.filter(id => !specials.has(id));
|