Spaces:
Running
Running
Commit
·
a379dd4
1
Parent(s):
a1f6147
model selector
Browse files
results/qwen3-30B-A3-results.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
src/components/viewer-tab.tsx
CHANGED
@@ -1,21 +1,33 @@
|
|
1 |
"use client";
|
2 |
|
3 |
-
import
|
4 |
-
import
|
5 |
-
|
6 |
-
import mockResults from "../../results/qwen3.json"
|
7 |
// import mockResults from "../../qwen3-final-results.json"
|
8 |
import { useMemo, useState, useEffect } from "react";
|
9 |
import { Card } from "@/components/ui/card";
|
10 |
import ForceDirectedGraph from "@/components/force-directed-graph";
|
11 |
import RunsList from "@/components/runs-list";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
export default function ViewerTab({
|
21 |
handleTryRun,
|
@@ -24,18 +36,23 @@ export default function ViewerTab({
|
|
24 |
}) {
|
25 |
const [selectedRun, setSelectedRun] = useState<number | null>(null);
|
26 |
const [runs, setRuns] = useState<Run[]>([]);
|
27 |
-
|
28 |
-
const fetchDataset = async () => {
|
29 |
-
console.log("Fetching dataset...");
|
30 |
-
console.log(Object.keys(mockResults));
|
31 |
-
setRuns(mockResults.runs);
|
32 |
-
|
33 |
-
return;
|
34 |
-
};
|
35 |
|
36 |
useEffect(() => {
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
const handleRunSelect = (runId: number) => {
|
41 |
setSelectedRun(runId);
|
@@ -45,12 +62,40 @@ export default function ViewerTab({
|
|
45 |
return runs.filter(run => run.result === "win");
|
46 |
}, [runs]);
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
return (
|
49 |
<div className="grid grid-cols-1 md:grid-cols-12 gap-4 h-[calc(100vh-200px)] max-h-[calc(100vh-200px)] overflow-hidden p-2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
<div className="md:col-span-3 flex flex-col max-h-full overflow-hidden">
|
51 |
<div className="bg-card rounded-lg p-3 border flex-grow overflow-hidden flex flex-col">
|
52 |
<h3 className="text-sm font-medium mb-2 text-muted-foreground flex-shrink-0">
|
53 |
-
|
54 |
</h3>
|
55 |
<div className="flex-grow overflow-hidden">
|
56 |
<RunsList
|
@@ -65,7 +110,7 @@ export default function ViewerTab({
|
|
65 |
|
66 |
<div className="md:col-span-9 max-h-full overflow-hidden">
|
67 |
<Card className="w-full h-full flex items-center justify-center p-0 m-0 overflow-hidden">
|
68 |
-
<ForceDirectedGraph runs={
|
69 |
</Card>
|
70 |
</div>
|
71 |
</div>
|
|
|
1 |
"use client";
|
2 |
|
3 |
+
import q3Results from "../../results/qwen3.json"
|
4 |
+
import q3_30B_A3B_Results from "../../results/qwen3-30B-A3-results.json"
|
|
|
|
|
5 |
// import mockResults from "../../qwen3-final-results.json"
|
6 |
import { useMemo, useState, useEffect } from "react";
|
7 |
import { Card } from "@/components/ui/card";
|
8 |
import ForceDirectedGraph from "@/components/force-directed-graph";
|
9 |
import RunsList from "@/components/runs-list";
|
10 |
+
import {
|
11 |
+
Select,
|
12 |
+
SelectContent,
|
13 |
+
SelectItem,
|
14 |
+
SelectTrigger,
|
15 |
+
SelectValue
|
16 |
+
} from "@/components/ui/select";
|
17 |
+
import { Run as ForceGraphRun } from "@/components/reasoning-trace";
|
18 |
|
19 |
+
const models = {
|
20 |
+
"Qwen3-14B": q3Results,
|
21 |
+
"Qwen3-30B-A3B": q3_30B_A3B_Results,
|
22 |
+
}
|
23 |
+
|
24 |
+
// Use the type expected by RunsList
|
25 |
+
interface Run {
|
26 |
+
start_article: string;
|
27 |
+
destination_article: string;
|
28 |
+
steps: string[];
|
29 |
+
result: string;
|
30 |
+
}
|
31 |
|
32 |
export default function ViewerTab({
|
33 |
handleTryRun,
|
|
|
36 |
}) {
|
37 |
const [selectedRun, setSelectedRun] = useState<number | null>(null);
|
38 |
const [runs, setRuns] = useState<Run[]>([]);
|
39 |
+
const [selectedModel, setSelectedModel] = useState<string>("Qwen3-14B");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
useEffect(() => {
|
42 |
+
// Convert the model data to the format expected by RunsList
|
43 |
+
const convertedRuns = models[selectedModel].runs.map((run: {
|
44 |
+
start_article: string;
|
45 |
+
destination_article: string;
|
46 |
+
steps: { type: string; article: string }[];
|
47 |
+
result: string;
|
48 |
+
}) => ({
|
49 |
+
start_article: run.start_article,
|
50 |
+
destination_article: run.destination_article,
|
51 |
+
steps: run.steps.map((step: { article: string }) => step.article),
|
52 |
+
result: run.result
|
53 |
+
}));
|
54 |
+
setRuns(convertedRuns);
|
55 |
+
}, [selectedModel]);
|
56 |
|
57 |
const handleRunSelect = (runId: number) => {
|
58 |
setSelectedRun(runId);
|
|
|
62 |
return runs.filter(run => run.result === "win");
|
63 |
}, [runs]);
|
64 |
|
65 |
+
// Convert the runs to the format expected by ForceDirectedGraph
|
66 |
+
const forceGraphRuns = useMemo(() => {
|
67 |
+
return filterRuns.map((run): ForceGraphRun => ({
|
68 |
+
start_article: run.start_article,
|
69 |
+
destination_article: run.destination_article,
|
70 |
+
steps: run.steps.map(article => ({ type: "move", article }))
|
71 |
+
}));
|
72 |
+
}, [filterRuns]);
|
73 |
+
|
74 |
return (
|
75 |
<div className="grid grid-cols-1 md:grid-cols-12 gap-4 h-[calc(100vh-200px)] max-h-[calc(100vh-200px)] overflow-hidden p-2">
|
76 |
+
<Card className="p-2 col-span-12 h-12 row-start-1">
|
77 |
+
<div className="flex items-center justify-between h-full">
|
78 |
+
<h3 className="text-sm font-medium text-muted-foreground flex-shrink-0">
|
79 |
+
Models
|
80 |
+
</h3>
|
81 |
+
<Select value={selectedModel} onValueChange={setSelectedModel}>
|
82 |
+
<SelectTrigger className="w-[180px]">
|
83 |
+
<SelectValue placeholder="Select model" />
|
84 |
+
</SelectTrigger>
|
85 |
+
<SelectContent>
|
86 |
+
{Object.keys(models).map((modelName) => (
|
87 |
+
<SelectItem key={modelName} value={modelName}>
|
88 |
+
{modelName}
|
89 |
+
</SelectItem>
|
90 |
+
))}
|
91 |
+
</SelectContent>
|
92 |
+
</Select>
|
93 |
+
</div>
|
94 |
+
</Card>
|
95 |
<div className="md:col-span-3 flex flex-col max-h-full overflow-hidden">
|
96 |
<div className="bg-card rounded-lg p-3 border flex-grow overflow-hidden flex flex-col">
|
97 |
<h3 className="text-sm font-medium mb-2 text-muted-foreground flex-shrink-0">
|
98 |
+
Runs
|
99 |
</h3>
|
100 |
<div className="flex-grow overflow-hidden">
|
101 |
<RunsList
|
|
|
110 |
|
111 |
<div className="md:col-span-9 max-h-full overflow-hidden">
|
112 |
<Card className="w-full h-full flex items-center justify-center p-0 m-0 overflow-hidden">
|
113 |
+
<ForceDirectedGraph runs={forceGraphRuns} runId={selectedRun} />
|
114 |
</Card>
|
115 |
</div>
|
116 |
</div>
|