-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Helpers + Streamlit refactor #102
base: main
Are you sure you want to change the base?
Conversation
* initial streamlit refactoring pass * cleanup and fixes * fix refiner strength * Modify params correctly * fix exception
I've tested streamlit and all seems to be working well there still. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR contains many formatting. Is it completely done by pylint? If not, can you show your VSCode Python format setting (setting.json) and add to the repo? I hope people can follow the same style.
Re-tested streamlit and made some fixes, I've also reverted to a |
c[k], uc[k] = map( | ||
lambda y: y[k][: math.prod(num_samples)].to(device), (c, uc) | ||
lambda y: y[k][: math.prod(num_samples)].to( | ||
device_manager.device | ||
), | ||
(c, uc), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, this .map
abomination should just be
c[k], uc[k] = map( | |
lambda y: y[k][: math.prod(num_samples)].to(device), (c, uc) | |
lambda y: y[k][: math.prod(num_samples)].to( | |
device_manager.device | |
), | |
(c, uc), | |
) | |
c[k] = c[k][: math.prod(num_samples)].to(device_manager.device) | |
uc[k] = uc[k][: math.prod(num_samples)].to(device_manager.device) |
(and as discussed (and implemented) before, num_samples
being a list one needs to math.prod
on doesn't make any sense, but that's probably beyond the scope of this PR.)
c[k], uc[k] = map( | ||
lambda y: y[k][:num_samples].to(device_manager.device), (c, uc) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c[k], uc[k] = map( | |
lambda y: y[k][:num_samples].to(device_manager.device), (c, uc) | |
) | |
c[k] = c[k][:num_samples].to(device_manager.device) | |
uc[k] = uc[k][:num_samples].to(device_manager.device) |
(funny how num_samples
is an int
here 😁)
Would be nice to get this squashed in so I could again rebase my PRs ;-) |
This'll probably need more fixing with the myriad of demo changes in 059d8e9 😞 |
Updates to api/helper functions:
Txt2NoisyDiscretizationWrapper
to helpers and creates a function to apply discretization wrappers conditionally.SamplingPipeline
constructor to allow passing a custom model_spec, and improve default paths behavior0.1.1