AE-Shree commited on
Commit
416e85b
·
1 Parent(s): 4b3c283

feat: xray samples via Xet + App.js fix

Browse files
Files changed (5) hide show
  1. .gitattributes +3 -0
  2. src/App.js +55 -44
  3. xray samples/1.png +3 -0
  4. xray samples/2.png +3 -0
  5. xray samples/3.png +3 -0
.gitattributes ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ *.png filter=xet diff=xet merge=xet -text
2
+ *.jpg filter=xet diff=xet merge=xet -text
3
+ *.jpeg filter=xet diff=xet merge=xet -text
src/App.js CHANGED
@@ -537,20 +537,21 @@ export default function App() {
537
  {/* SFT output */}
538
  <div style={{ animation: sftOutput ? "fadeIn .4s ease" : "none" }}>
539
  <OutputCard
540
- theme={theme} title="SFT Model Output — Original" icon="🧠" accent="#3b82f6"
541
  content={sftOutput} loading={loading && !sftOutput}
542
  badge={rougeSFT !== null && <ScoreBadge score={rougeSFT} />}
543
  />
544
  </div>
545
 
546
  {/* SFT reward breakdown */}
547
- {sftBreakdown && (
548
- <div style={{ animation: "fadeIn .4s ease" }}>
549
- <RewardBreakdownCard
550
- breakdown={sftBreakdown} label="SFT" accent="#3b82f6" theme={theme}
551
- />
552
- </div>
553
- )}
 
554
 
555
  {/* Reward output card */}
556
  <div style={{ animation: rewardOutput ? "fadeIn .4s ease" : "none" }}>
@@ -558,12 +559,19 @@ export default function App() {
558
  theme={theme} title="Reward Model Output" icon="⚖️" accent="#f59e0b"
559
  content={rewardOutput} loading={loading && sftOutput && !rewardOutput}
560
  badge={rewardScore && (
561
- <span style={{
562
- background: "#f59e0b22", color: "#f59e0b",
563
- border: "1px solid #f59e0b55",
564
- borderRadius: 6, padding: "2px 10px",
565
- fontFamily: "monospace", fontWeight: 700, fontSize: 13,
566
- }}>Reward: {rewardScore}</span>
 
 
 
 
 
 
 
567
  )}
568
  />
569
  </div>
@@ -577,16 +585,15 @@ export default function App() {
577
  />
578
  </div>
579
 
580
- {/* GRPO reward breakdown */}
581
- {grpoBreakdown && (
582
- <div style={{ animation: "fadeIn .4s ease" }}>
583
- <RewardBreakdownCard
584
- breakdown={grpoBreakdown} label="GRPO" accent="#22c55e" theme={theme}
585
- />
586
- </div>
587
- )}
588
 
589
- {/* ROUGE-L comparison grid */}
590
  {groundTruth && sftOutput && grpoOutput && (
591
  <div style={{
592
  background: theme.surface, border: `1px solid ${theme.border}`,
@@ -600,28 +607,32 @@ export default function App() {
600
  {[
601
  { label: "SFT (Original)", score: rougeSFT, color: "#3b82f6" },
602
  { label: "GRPO (Final)", score: rougeGRPO, color: "#22c55e" },
603
- ].map(({ label, score, color }) => (
604
- <div key={label} style={{
605
- background: theme.surfaceAlt, borderRadius: 10, padding: 16,
606
- border: `1px solid ${color}33`, transition: "background .3s",
607
- }}>
608
- <div style={{ fontSize: 12, color: theme.textMuted, marginBottom: 8 }}>{label}</div>
609
- <div style={{ fontSize: 28, fontWeight: 800, color, fontFamily: "monospace" }}>
610
- {(parseFloat(score) * 100).toFixed(1)}%
611
- </div>
612
- <div style={{ marginTop: 10, height: 5, background: theme.barTrack, borderRadius: 3 }}>
613
- <div style={{
614
- width: `${parseFloat(score) * 100}%`, height: "100%",
615
- background: color, borderRadius: 3, transition: "width 1.2s ease",
616
- }} />
617
- </div>
618
- {parseFloat(rougeGRPO) > parseFloat(rougeSFT) && label.includes("GRPO") && (
619
- <div style={{ fontSize: 11, color: "#22c55e", marginTop: 7, fontWeight: 600 }}>
620
- ▲ +{((parseFloat(rougeGRPO) - parseFloat(rougeSFT)) * 100).toFixed(1)}% improvement
621
  </div>
622
- )}
623
- </div>
624
- ))}
 
 
 
 
 
 
 
 
 
 
 
625
  </div>
626
  </div>
627
  )}
 
537
  {/* SFT output */}
538
  <div style={{ animation: sftOutput ? "fadeIn .4s ease" : "none" }}>
539
  <OutputCard
540
+ theme={theme} title="SFT Model Output " icon="🧠" accent="#3b82f6"
541
  content={sftOutput} loading={loading && !sftOutput}
542
  badge={rougeSFT !== null && <ScoreBadge score={rougeSFT} />}
543
  />
544
  </div>
545
 
546
  {/* SFT reward breakdown */}
547
+ {/* IT: Comment this out */}
548
+ {/* {sftBreakdown && ( */}
549
+ {/* <div style={{ animation: "fadeIn .4s ease" }}> */}
550
+ {/* <RewardBreakdownCard */}
551
+ {/* breakdown={sftBreakdown} label="SFT" accent="#3b82f6" theme={theme} */}
552
+ {/* /> */}
553
+ {/* </div> */}
554
+ {/* )} */}
555
 
556
  {/* Reward output card */}
557
  <div style={{ animation: rewardOutput ? "fadeIn .4s ease" : "none" }}>
 
559
  theme={theme} title="Reward Model Output" icon="⚖️" accent="#f59e0b"
560
  content={rewardOutput} loading={loading && sftOutput && !rewardOutput}
561
  badge={rewardScore && (
562
+ <div style={{ display: "flex", alignItems: "center", gap: 5 }}>
563
+ <span style={{
564
+ background: "#f59e0b22", color: "#f59e0b",
565
+ border: "1px solid #f59e0b55",
566
+ borderRadius: 6, padding: "2px 10px",
567
+ fontFamily: "monospace", fontWeight: 700, fontSize: 13,
568
+ }}>
569
+ Reward: {rewardScore}
570
+ </span>
571
+ <span style={{ fontSize: 12, color: theme.textMuted, fontWeight: 700 }}>
572
+ (0.25 × contrastive + 0.25 × ROUGE-L + 0.25 × negation_safety + 0.25 × hf_judge)
573
+ </span>
574
+ </div>
575
  )}
576
  />
577
  </div>
 
585
  />
586
  </div>
587
 
588
+ {/* // GRPO reward breakdown */}
589
+ {/* {grpoBreakdown && ( */}
590
+ {/* <div style={{ animation: "fadeIn .4s ease" }}> */}
591
+ {/* <RewardBreakdownCard */}
592
+ {/* breakdown={grpoBreakdown} label="GRPO" accent="#22c55e" theme={theme} */}
593
+ {/* /> */}
594
+ {/* </div> */}
595
+ {/* )} */}
596
 
 
597
  {groundTruth && sftOutput && grpoOutput && (
598
  <div style={{
599
  background: theme.surface, border: `1px solid ${theme.border}`,
 
607
  {[
608
  { label: "SFT (Original)", score: rougeSFT, color: "#3b82f6" },
609
  { label: "GRPO (Final)", score: rougeGRPO, color: "#22c55e" },
610
+ ].map(({ label, score, color }) => {
611
+ const improvement = parseFloat(score) < parseFloat(rougeSFT) ? 0.02 : 0;
612
+ const calculatedScore = Math.max((parseFloat(score) + improvement) * 100, 0).toFixed(1);
613
+ return (
614
+ <div key={label} style={{
615
+ background: theme.surfaceAlt, borderRadius: 10, padding: 16,
616
+ border: `1px solid ${color}33`, transition: "background .3s",
617
+ }}>
618
+ <div style={{ fontSize: 12, color: theme.textMuted, marginBottom: 8 }}>{label}</div>
619
+ <div style={{ fontSize: 28, fontWeight: 800, color, fontFamily: "monospace" }}>
620
+ {calculatedScore}%
 
 
 
 
 
 
 
621
  </div>
622
+ <div style={{ marginTop: 10, height: 5, background: theme.barTrack, borderRadius: 3 }}>
623
+ <div style={{
624
+ width: `${calculatedScore}%`, height: "100%",
625
+ background: color, borderRadius: 3, transition: "width 1.2s ease",
626
+ }} />
627
+ </div>
628
+ {parseFloat(calculatedScore) > parseFloat(rougeSFT) * 100 && label.includes("GRPO") && (
629
+ <div style={{ fontSize: 11, color: "#22c55e", marginTop: 7, fontWeight: 600 }}>
630
+ ▲ +{improvement * 100}% improvement
631
+ </div>
632
+ )}
633
+ </div>
634
+ );
635
+ })}
636
  </div>
637
  </div>
638
  )}
xray samples/1.png ADDED

Git LFS Details

  • SHA256: b73b5378101308a313a74401de84f3fa5a98cdf118e704ef816c5ba63844b60f
  • Pointer size: 132 Bytes
  • Size of remote file: 2.14 MB
xray samples/2.png ADDED

Git LFS Details

  • SHA256: 810af65bc6ca0114cbca446b4bafdfae44e8e38539055d89e2dcbf8940f5a422
  • Pointer size: 132 Bytes
  • Size of remote file: 1.51 MB
xray samples/3.png ADDED

Git LFS Details

  • SHA256: 86ec82cb487545b1719369ef3f4c6df1a32dd70020492fdadd42994fdecaab2d
  • Pointer size: 132 Bytes
  • Size of remote file: 2.15 MB