Update index.html
Browse files- index.html +2 -7
index.html
CHANGED
|
@@ -47,9 +47,7 @@ function switchTab(idx){
|
|
| 47 |
tabs[idx].classList.add("active");
|
| 48 |
}
|
| 49 |
|
| 50 |
-
// 更鲁棒CSV解析,兼容HF返回的换行
|
| 51 |
function parseCSV(text) {
|
| 52 |
-
// 统一换行符
|
| 53 |
text = text.replace(/\r\n/g,"\n").replace(/\r/g,"\n");
|
| 54 |
const lines = text.trim().split("\n").filter(line=>line.trim()!=='');
|
| 55 |
const headers = lines[0].split(",").map(h=>h.trim());
|
|
@@ -79,18 +77,15 @@ function buildTable(title, data, sortKey){
|
|
| 79 |
return html;
|
| 80 |
}
|
| 81 |
|
| 82 |
-
//
|
| 83 |
-
const
|
| 84 |
-
const csvUrl = `https://huggingface.co/datasets/CamoAiLab/Infernet/resolve/main/eval_submissions/results.csv?t=${timestamp}`;
|
| 85 |
|
| 86 |
async function loadData(){
|
| 87 |
try {
|
| 88 |
const res = await fetch(csvUrl);
|
| 89 |
if(!res.ok) throw new Error(`HTTP ${res.status}`);
|
| 90 |
const csvText = await res.text();
|
| 91 |
-
console.log("csv raw text:", csvText);
|
| 92 |
const data = parseCSV(csvText);
|
| 93 |
-
console.log("parsed data:", data);
|
| 94 |
|
| 95 |
if(data.length ===0){
|
| 96 |
document.body.insertAdjacentHTML("beforeend",`<p style="color:red">Warning: CSV parsed zero rows</p>`);
|
|
|
|
| 47 |
tabs[idx].classList.add("active");
|
| 48 |
}
|
| 49 |
|
|
|
|
| 50 |
function parseCSV(text) {
|
|
|
|
| 51 |
text = text.replace(/\r\n/g,"\n").replace(/\r/g,"\n");
|
| 52 |
const lines = text.trim().split("\n").filter(line=>line.trim()!=='');
|
| 53 |
const headers = lines[0].split(",").map(h=>h.trim());
|
|
|
|
| 77 |
return html;
|
| 78 |
}
|
| 79 |
|
| 80 |
+
// 读取space本地csv,不再跨域访问dataset
|
| 81 |
+
const csvUrl = "./results.csv";
|
|
|
|
| 82 |
|
| 83 |
async function loadData(){
|
| 84 |
try {
|
| 85 |
const res = await fetch(csvUrl);
|
| 86 |
if(!res.ok) throw new Error(`HTTP ${res.status}`);
|
| 87 |
const csvText = await res.text();
|
|
|
|
| 88 |
const data = parseCSV(csvText);
|
|
|
|
| 89 |
|
| 90 |
if(data.length ===0){
|
| 91 |
document.body.insertAdjacentHTML("beforeend",`<p style="color:red">Warning: CSV parsed zero rows</p>`);
|