Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type cast fix for examples/notebooks/Tutorial-Prompt-Optimization.ipynb #119

Open
mounir-portia opened this issue Sep 5, 2024 · 0 comments

Comments

@mounir-portia
Copy link

Peeps,

Love this repo so thanks a mil! Wanted to flag that for examples/notebooks/Tutorial-Prompt-Optimization.ipynb to work, I had to modify a line in the eval_sample function:
y = tg.Variable(y, requires_grad=False, role_description="correct answer for the query")
should actually be y = tg.Variable(int(y), requires_grad=False, role_description="correct answer for the query").

I believe the process of populating y in the class BigBenchHard ends up populating it as a numpy.int64 so that throws off the Variable declaration afterwards since it's expecting Union[str, bytes] as the data type for the value.

Hope this makes sense, and huge love and respect for your work on TG,
Mounir (mostly an eternal noob so apologies if I missed something obvious)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant