Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
845b7535
Commit
845b7535
authored
Feb 09, 2025
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a filter toggle for comparing LLM outputs. Added deep seek results for comparison.
parent
dbbd2610
Pipeline
#13330
passed with stages
in 1 minute 53 seconds
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
2 deletions
+57
-2
BehaviorOutputs.json
src/test/BehaviorOutputs.json
+0
-0
CompareOutputs.html
src/test/CompareOutputs.html
+57
-2
No files found.
src/test/BehaviorOutputs.json
View file @
845b7535
This diff is collapsed.
Click to expand it.
src/test/CompareOutputs.html
View file @
845b7535
...
...
@@ -53,10 +53,22 @@
/* Improved Readability */
td
,
th
{
font-size
:
16px
;
}
/* Model Filter Checkboxes */
.model-filters
{
margin-bottom
:
10px
;
}
.model-filters
label
{
margin-right
:
15px
;
cursor
:
pointer
;
}
</style>
</head>
<body>
<h2>
Behavior Test Outputs
</h2>
<!-- Model Filter Checkboxes -->
<div
class=
"model-filters"
id=
"modelFilters"
></div>
<table
id=
"outputTable"
>
<thead>
<tr>
...
...
@@ -67,12 +79,38 @@
</table>
<script>
let
availableModels
=
new
Set
();
async
function
loadBehaviorData
()
{
try
{
const
response
=
await
fetch
(
'BehaviorOutputs.json'
);
const
data
=
await
response
.
json
();
const
tableBody
=
document
.
querySelector
(
"#outputTable tbody"
);
// Collect unique model names
Object
.
values
(
data
).
forEach
(
modelResponses
=>
{
Object
.
keys
(
modelResponses
).
forEach
(
model
=>
availableModels
.
add
(
model
));
});
// Generate model checkboxes
const
filtersDiv
=
document
.
getElementById
(
"modelFilters"
);
availableModels
.
forEach
(
model
=>
{
const
sanitizedModel
=
sanitizeClassName
(
model
);
const
checkbox
=
document
.
createElement
(
"input"
);
checkbox
.
type
=
"checkbox"
;
checkbox
.
checked
=
true
;
checkbox
.
id
=
sanitizedModel
;
checkbox
.
onchange
=
updateModelVisibility
;
const
label
=
document
.
createElement
(
"label"
);
label
.
htmlFor
=
sanitizedModel
;
label
.
appendChild
(
checkbox
);
label
.
appendChild
(
document
.
createTextNode
(
" "
+
model
));
filtersDiv
.
appendChild
(
label
);
});
// Sort prompts alphabetically
const
sortedKeys
=
Object
.
keys
(
data
).
sort
();
...
...
@@ -91,8 +129,10 @@
nestedRow
.
classList
.
add
(
"nested"
);
nestedRow
.
innerHTML
=
`<td>
<table model-count="
${
modelCount
}
">
<tr>
${
Object
.
keys
(
modelResponses
).
map
(
model
=>
`<th>
${
escapeHTML
(
model
)}
</th>`
).
join
(
""
)}
</tr>
<tr>
${
Object
.
values
(
modelResponses
).
map
(
output
=>
`<td>
${
formatText
(
escapeHTML
(
output
))}
</td>`
).
join
(
""
)}
</tr>
<tr>
${
Object
.
keys
(
modelResponses
).
map
(
model
=>
`<th class="model-col
${
sanitizeClassName
(
model
)}
">
${
escapeHTML
(
model
)}
</th>`
).
join
(
""
)}
</tr>
<tr>
${
Object
.
keys
(
modelResponses
).
map
(
model
=>
`<td class="model-col
${
sanitizeClassName
(
model
)}
">
${
formatText
(
escapeHTML
(
modelResponses
[
model
]))}
</td>`
).
join
(
""
)}
</tr>
</table>
</td>`
;
tableBody
.
appendChild
(
nestedRow
);
...
...
@@ -102,6 +142,16 @@
}
}
function
updateModelVisibility
()
{
availableModels
.
forEach
(
model
=>
{
const
sanitizedModel
=
sanitizeClassName
(
model
);
const
isChecked
=
document
.
getElementById
(
sanitizedModel
).
checked
;
document
.
querySelectorAll
(
`.model-col.
${
sanitizedModel
}
`
).
forEach
(
el
=>
{
el
.
style
.
display
=
isChecked
?
""
:
"none"
;
});
});
}
function
toggleNested
(
row
)
{
document
.
querySelectorAll
(
'.row'
).
forEach
(
r
=>
r
.
classList
.
remove
(
'highlight'
));
document
.
querySelectorAll
(
'.nested'
).
forEach
(
n
=>
n
.
style
.
display
=
'none'
);
...
...
@@ -138,6 +188,11 @@
return
""
;
}
// Sanitize model names to be used in CSS classes
function
sanitizeClassName
(
model
)
{
return
model
.
replace
(
/
[^
a-zA-Z0-9
]
/g
,
"_"
);
// Replace non-alphanumeric characters with "_"
}
loadBehaviorData
();
</script>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment