"use client"; import * as hub from "@huggingface/hub"; import type { RepoDesignation } from "@huggingface/hub"; import mockResults from "../../qwen3-final-results.json"; import { useState } from "react"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import ForceDirectedGraph from "@/components/force-directed-graph"; import ReasoningTrace from "@/components/reasoning-trace"; import RunsList from "@/components/runs-list"; type Run = { id: number; start: string; end: string; hops: number; }; // Sample data - would be fetched from HuggingFace dataset in a real implementation const sampleRuns = [ { id: 1, start: "Pokemon", end: "Canada", hops: 16 }, { id: 2, start: "Pokemon", end: "Canada", hops: 16 }, { id: 3, start: "Pokemon", end: "Canada", hops: 16 }, { id: 4, start: "Pokemon", end: "Canada", hops: 16 }, // Add more sample runs as needed ]; const datasets = [ { id: "dataset1", name: "Eureka-Lab/PHYBench" }, { id: "dataset2", name: "Eureka-Lab/PHYBench-LLM" }, ]; export default function ViewerTab() { const [selectedDataset, setSelectedDataset] = useState(""); const [selectedRun, setSelectedRun] = useState(null); const [runs, setRuns] = useState([]); const [loading, setLoading] = useState(false); const fetchDataset = async () => { console.log("Fetching dataset..."); console.log(Object.keys(mockResults)); setRuns(mockResults.runs.slice(0, 10)); return; setLoading(true); // https://huggingface.co/datasets/HuggingFaceTB/wikispeedia-traces/resolve/main/qwen3-final-results.json // const response = await fetch("https://huggingface.co/datasets/HuggingFaceTB/wikispeedia-traces/resolve/main/qwen3-final-results.json"); // const json = await response.json(); // setRuns(json.runs); // setLoading(false); // const repo: RepoDesignation = { // type: "dataset", // name: "HuggingFaceTB/wikispeedia-traces", // }; // const file = await hub.downloadFile({ repo, path: "qwen3-final-results.json" }); // if (!file) { // console.error("Failed to download file"); // return; // } // const text = await file.text(); // console.log("GOT FILE!", text); // const json = JSON.parse(text); // setRuns(json.runs); // setLoading(false); }; const handleDatasetChange = (value: string) => { setSelectedDataset(value); setSelectedRun(null); }; const handleRunSelect = (runId: number) => { setSelectedRun(runId); }; return (
{loading &&

Loading...

}

Available Runs

); }