Closed lordofthejars closed 1 month ago
Hmm I can't figure out how to run the workflows, they should work
For example:
JavaFxProgressBar p=....
SafeTensorSupport.maybeDownload(dir, model, (s, c, t) -> {
p.update(c/t);
}
Or for example because you want to log it in a special way:
SafeTensorSupport.maybeDownload(dir, model, (s, c, t) -> {
mySpecialLogger.info(c/t);
}
It is just an example,but this could be how you can update a JafaFx component, instead of using the maybeDownload
with all required parameters like Http headers and so on.
Sorry I was referring to the projects Unit Test GitHub Action. This is now working
Thanks, now I will start working on what we discussed about changing the functional interface into an interface.
Overloads download method to specify progress.
Notifying progress is something that might sound informative task, but in production environments might be a key operation, for example in case of a Java FX you might want to print a progress bar in the screen, or in a Kubernetes environment you might want to add a health check (Readiness check) till the download is completed.
Of course, there are multiple ways of doing it, but the library already provides the interface, so the best way is doing using it.
Instead of using the whole download method with all parameters, I have just added a new method that takes the model, where to store it and also let you redefine the progress bar. In this way, it is easier for developer to cover this use case and not having to pass all the arguments.
This is a helping method as developers can still use the full parameters method to do it.