Closed erickpeirson closed 2 weeks ago
Nice - definitely a necessary change for deploying to places like lambda functions. Thanks!
https://github.com/dleemiller/WordLlama/pull/42
I have decided to clean everything up and simplify the API by removing the weights_dir
as well. That feels legacy and over-complicated to me now to have both keyword arguments.
Presently, passing
cache_dir: Path
toWordLlama.load()
has no impact on the cache directory where tokenizer assets are stored. This makes it impossible to useWordLlama
in an environment where the default cache path (the user's home directory) is not writable, which is often the case in production scenarios.This PR does two things:
cache_dir
parameter on theWordLlama.load()
method to be the cache root directory, within which thetokenizers
andweights
subdirectories are created;cache_dir
is passed tocheck_and_download_tokenizer
and used, so that all writes occur within a configurable cache directory;Note that this will effectively bust the cache on upgrade. But I'm hoping that's a small price to pay for the fix.