Skip to content

Commit

Permalink
fix: maia prediction checkmarks for varying maia versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjosethomas committed Dec 6, 2024
1 parent ca26d3a commit 38ec884
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Board/MovesContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface Props {
highlightIndices?: number[]
mobile?: boolean
termination?: Termination
currentMaiaModel?: string
}

export const MovesContainer: React.FC<Props> = ({
Expand All @@ -21,6 +22,7 @@ export const MovesContainer: React.FC<Props> = ({
highlightIndices,
mobile = false,
termination,
currentMaiaModel,
}: Props) => {
const controller = useContext(GameControllerContext)
const { isMobile } = useContext(WindowSizeContext)
Expand Down Expand Up @@ -66,7 +68,8 @@ export const MovesContainer: React.FC<Props> = ({
let predictedWhite, predictedBlack

if ('maiaEvaluations' in game) {
const evals = game.maiaEvaluations['maia_kdd_1100']
const evals =
game.maiaEvaluations[currentMaiaModel ?? 'maia_kdd_1100']

const prevEvals = evals?.[prevMoveIndex]
const whiteEvals = evals?.[whiteMoveIndex]
Expand Down
2 changes: 2 additions & 0 deletions src/pages/analysis/[...id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ const Analysis: React.FC<Props> = ({
game={analyzedGame}
setCurrentMove={setCurrentMove}
termination={analyzedGame.termination}
currentMaiaModel={currentMaiaModel}
/>
</div>
<div className="flex-none">
Expand Down Expand Up @@ -653,6 +654,7 @@ const Analysis: React.FC<Props> = ({
game={analyzedGame}
setCurrentMove={setCurrentMove}
termination={analyzedGame.termination}
currentMaiaModel={currentMaiaModel}
/>
</div>
<div>
Expand Down

0 comments on commit 38ec884

Please sign in to comment.