Skip to content

Commit 7e4733f

Browse files
committed
sync new content
1 parent 8b49ddd commit 7e4733f

File tree

10 files changed

+359
-183
lines changed

10 files changed

+359
-183
lines changed

app/(dashboard)/layout.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ function UserMenu() {
3535
className="text-sm font-medium text-gray-700 hover:text-gray-900"
3636
>
3737
</Link>
38+
<Button asChild className="rounded-full">
39+
<Link href="https://arxiv.org/abs/2510.01171" className="flex items-center gap-2">
40+
<FileText size={16} />
41+
Paper
42+
</Link>
43+
</Button>
3844
<Button asChild className="rounded-full">
3945
<Link href="https://github.com/CHATS-lab/verbalized-sampling" className="flex items-center gap-2">
4046
<Github size={16} />
@@ -48,12 +54,6 @@ function UserMenu() {
4854
Blog
4955
</Link>
5056
</Button>
51-
<Button asChild className="rounded-full">
52-
<Link href="https://arxiv.org/pdf/2510.01171" className="flex items-center gap-2">
53-
<FileText size={16} />
54-
Paper
55-
</Link>
56-
</Button>
5757
</>
5858
);
5959
}

app/(dashboard)/page.tsx

Lines changed: 237 additions & 147 deletions
Large diffs are not rendered by default.

app/(dashboard)/terminal copy.tsx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
'use client';
2+
3+
import { useState, useEffect } from 'react';
4+
import { Copy, Check } from 'lucide-react';
5+
6+
export function Terminal() {
7+
const [terminalStep, setTerminalStep] = useState(0);
8+
const [copied, setCopied] = useState(false);
9+
const terminalSteps = [
10+
'conda create -n collabllm python=3.10',
11+
'conda activate collabllm',
12+
'pip install collabllm',
13+
'',
14+
'git clone https://github.com/Wuyxin/collabllm.git',
15+
'python -m scripts.engine.build_dataset <...>',
16+
'python -m scripts.train.{sft/*_dpo/ppo} <...>',
17+
];
18+
19+
useEffect(() => {
20+
const timer = setTimeout(() => {
21+
setTerminalStep((prev) =>
22+
prev < terminalSteps.length - 1 ? prev + 1 : prev
23+
);
24+
}, 500);
25+
26+
return () => clearTimeout(timer);
27+
}, [terminalStep]);
28+
29+
const copyToClipboard = () => {
30+
navigator.clipboard.writeText(terminalSteps.join('\n'));
31+
setCopied(true);
32+
setTimeout(() => setCopied(false), 2000);
33+
};
34+
35+
return (
36+
<div className="w-full rounded-lg shadow-lg overflow-hidden bg-gray-900 text-white font-mono text-sm relative">
37+
<div className="p-4">
38+
<div className="flex justify-between items-center mb-4">
39+
<div className="flex space-x-2">
40+
<div className="w-3 h-3 rounded-full bg-red-500"></div>
41+
<div className="w-3 h-3 rounded-full bg-yellow-500"></div>
42+
<div className="w-3 h-3 rounded-full bg-green-500"></div>
43+
</div>
44+
<button
45+
onClick={copyToClipboard}
46+
className="text-gray-400 hover:text-white transition-colors"
47+
aria-label="Copy to clipboard"
48+
>
49+
{copied ? (
50+
<Check className="h-5 w-5" />
51+
) : (
52+
<Copy className="h-5 w-5" />
53+
)}
54+
</button>
55+
</div>
56+
<div className="space-y-2">
57+
{terminalSteps.map((step, index) => (
58+
<div
59+
key={index}
60+
className={`${index > terminalStep ? 'opacity-0' : 'opacity-100'} transition-opacity duration-300`}
61+
>
62+
<span className="text-green-400">$</span> {step}
63+
</div>
64+
))}
65+
</div>
66+
</div>
67+
</div>
68+
);
69+
}

app/(dashboard)/terminal.tsx

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,82 @@
11
'use client';
22

33
import { useState, useEffect } from 'react';
4-
import { Copy, Check } from 'lucide-react';
4+
import { Copy, Check, RotateCcw } from 'lucide-react';
55

66
export function Terminal() {
77
const [terminalStep, setTerminalStep] = useState(0);
88
const [copied, setCopied] = useState(false);
99
const terminalSteps = [
10-
'conda create -n collabllm python=3.10',
11-
'conda activate collabllm',
12-
'pip install collabllm',
13-
'',
14-
'git clone https://github.com/Wuyxin/collabllm.git',
15-
'python -m scripts.engine.build_dataset <...>',
16-
'python -m scripts.train.{sft/*_dpo/ppo} <...>',
10+
{ line: 'Generate 10 responses to the user query. Each response should be approximately 200 words.', showPrompt: true },
11+
{ line: '', showPrompt: false },
12+
{ line: 'Return the responses in JSON format with the key: "responses" (list of dicts). Each dictionary must include:', showPrompt: false },
13+
{ line: '- \'text\': the response string only (no explanation or extra text).', showPrompt: false },
14+
{ line: '- \'probability\': the estimated probability from 0.0 to 1.0 of this response given the input prompt (relative to the full distribution).', showPrompt: false },
15+
{ line: '', showPrompt: false },
16+
{ line: 'Randomly sample the responses from the full distribution. Return ONLY the JSON object, with no additional explanations or text.', showPrompt: false },
17+
{ line: '', showPrompt: false },
18+
{ line: '<user_query>Write a short story about a bear.</user_query>', showPrompt: true },
1719
];
1820

19-
useEffect(() => {
20-
const timer = setTimeout(() => {
21-
setTerminalStep((prev) =>
22-
prev < terminalSteps.length - 1 ? prev + 1 : prev
23-
);
24-
}, 500);
21+
const fullPrompt = terminalSteps.map(step => step.line).join('\n');
2522

26-
return () => clearTimeout(timer);
27-
}, [terminalStep]);
23+
useEffect(() => {
24+
if (terminalStep < terminalSteps.length) {
25+
const timer = setTimeout(() => {
26+
setTerminalStep(prev => prev + 1);
27+
}, 800);
28+
return () => clearTimeout(timer);
29+
}
30+
}, [terminalStep, terminalSteps.length]);
2831

2932
const copyToClipboard = () => {
30-
navigator.clipboard.writeText(terminalSteps.join('\n'));
33+
navigator.clipboard.writeText(fullPrompt);
3134
setCopied(true);
3235
setTimeout(() => setCopied(false), 2000);
3336
};
3437

38+
const restartAnimation = () => {
39+
setTerminalStep(0);
40+
};
41+
3542
return (
36-
<div className="w-full rounded-lg shadow-lg overflow-hidden bg-gray-900 text-white font-mono text-sm relative">
43+
<div className="w-full rounded-lg shadow-lg overflow-hidden bg-gray-900 text-white font-mono text-sm relative min-h-[400px]">
3744
<div className="p-4">
3845
<div className="flex justify-between items-center mb-4">
3946
<div className="flex space-x-2">
4047
<div className="w-3 h-3 rounded-full bg-red-500"></div>
4148
<div className="w-3 h-3 rounded-full bg-yellow-500"></div>
4249
<div className="w-3 h-3 rounded-full bg-green-500"></div>
4350
</div>
44-
<button
45-
onClick={copyToClipboard}
46-
className="text-gray-400 hover:text-white transition-colors"
47-
aria-label="Copy to clipboard"
48-
>
49-
{copied ? (
50-
<Check className="h-5 w-5" />
51-
) : (
52-
<Copy className="h-5 w-5" />
53-
)}
54-
</button>
51+
<div className="flex space-x-2">
52+
<button
53+
onClick={restartAnimation}
54+
className="text-gray-400 hover:text-white transition-colors"
55+
aria-label="Restart animation"
56+
>
57+
<RotateCcw className="h-5 w-5" />
58+
</button>
59+
<button
60+
onClick={copyToClipboard}
61+
className="text-gray-400 hover:text-white transition-colors"
62+
aria-label="Copy to clipboard"
63+
>
64+
{copied ? (
65+
<Check className="h-5 w-5" />
66+
) : (
67+
<Copy className="h-5 w-5" />
68+
)}
69+
</button>
70+
</div>
5571
</div>
5672
<div className="space-y-2">
5773
{terminalSteps.map((step, index) => (
5874
<div
5975
key={index}
6076
className={`${index > terminalStep ? 'opacity-0' : 'opacity-100'} transition-opacity duration-300`}
6177
>
62-
<span className="text-green-400">$</span> {step}
78+
{step.showPrompt && <span className="text-green-400">$ </span>}
79+
{step.line}
6380
</div>
6481
))}
6582
</div>
66.3 KB
Loading

public/images/emergent_trend.png

197 KB
Loading

public/images/intro_teaser.jpg

557 KB
Loading

public/images/prob_tuning.png

141 KB
Loading
120 KB
Loading
495 KB
Loading

0 commit comments

Comments
 (0)