Add a few new CodeI/O samples, resolve numeric answer scoring bug (#332)

* add handful of codeio samples

* scoring fix
This commit is contained in:
Oliver Stanley 2025-03-11 22:55:33 +00:00 committed by GitHub
parent c3c6cc8051
commit f14662e213
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 1 deletions

View file

@ -173,7 +173,7 @@ class CodeIODataset(ProceduralDataset):
# TODO: Consider a more sophisticated distance metric for numeric values?
abs1, abs2 = abs(float(value1)), abs(float(value2))
divisor = max(min(abs1, abs2), 10e-5)
value_dist += (abs1 - abs2) / divisor
value_dist = max(len(value1), len(value2)) * abs((abs1 - abs2) / divisor)
except ValueError:
# Fall back on string edit distance
pass