Skip to content

Commit

Permalink
Fix precision calc
Browse files Browse the repository at this point in the history
  • Loading branch information
tedspare committed Oct 9, 2024
1 parent 1e3a72a commit 050d270
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- [2024-10-09] [Fix precision calc](https://github.com/RubricLab/memory/commit/52fc41e151c47e276c37a24b3489ba414d032a0b)
- [2024-10-09] [Generalize eval arch](https://github.com/RubricLab/memory/commit/bf80487850e840525a1521925a439d7d9fc8d638)
- [2024-10-09] [Add help cmd](https://github.com/RubricLab/memory/commit/9f35d0016dcd5d0f909cb77c2ea33ef70da60fb1)
- [2024-10-09] [Scaffold evals](https://github.com/RubricLab/memory/commit/3801514a795881c74ea225d02eeae001a07ee57a)
Expand Down
10 changes: 6 additions & 4 deletions evals/one-shot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export const runOneShotExamples = async ({ fast }: { fast?: boolean }) => {
let totalAttempts = 0

for await (const eg of EXAMPLES) {
let correctFacts = 0

totalFacts += eg.facts.length

console.log(chalk.yellow(`\n\n"${eg.content}"`))
Expand Down Expand Up @@ -56,6 +54,8 @@ export const runOneShotExamples = async ({ fast }: { fast?: boolean }) => {
const omitted: number[] = []

for (const [i, fact] of eg.facts.entries()) {
let correctFacts = 0

console.log(
`\n🎯 ${i + 1} of ${eg.facts.length}: ${chalk.magenta(fact.subject)} ${chalk.yellow(fact.relation)} ${chalk.blue(fact.object)}`
)
Expand All @@ -67,23 +67,25 @@ export const runOneShotExamples = async ({ fast }: { fast?: boolean }) => {
const correctRelation = fact.relation === relation
const correctObject = fact.object === object

if (omitted.includes(j)) continue
console.log(
`🤖 ${j + 1} of ${attempts.length}: ${chalk.magenta(format(subject, correctSubject))} ${chalk.yellow(
format(relation, correctRelation)
)} ${chalk.blue(format(object, correctObject))}`
)

if (omitted.includes(j)) continue

correctFacts += Number(correctSubject && correctRelation && correctObject)

if (correctFacts) {
omitted.push(j)
break
}
}

totalRecall += correctFacts
}

totalRecall += correctFacts
totalAttempts += attempts.length
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@rubriclab/memory",
"module": "index.ts",
"version": "0.0.6",
"version": "0.0.7",
"private": false,
"type": "module",
"devDependencies": {
Expand Down

0 comments on commit 050d270

Please sign in to comment.