gifted-lunch-20593
12/09/2024, 7:05 PMpython_sources(
name="foo",
dependencies=[
":model.safetensors",
],
)
file(
name="model.safetensors",
source=http_source(
filename="model.safetensors",
url="<https://huggingface.co/iiiorg/piiranha-v1-detect-personal-information/resolve/main/model.safetensors>",
len=1112954872,
sha256="3d503b6804dd734b8f5c9c98c7c38c431cba99778da53987a6945cf1503f3b82",
),
)
And when I run pants repl app:foo , the file model.safetensors is downloaded, but the repl runs inside project instead of a sandbox with the model.safetensors present.
The only way I found to materialize files and use them is to use run_shell_command and symlinking sandboxed files to repo's root dir ln -s {{chroot}}/app/model.safetensors model.safetensors .
ChatGPT/Google - no answers to this question.
Has anyone found workaround?gifted-lunch-20593
12/10/2024, 3:51 PMgifted-lunch-20593
12/10/2024, 3:53 PMhappy-kitchen-89482
12/10/2024, 8:41 PMrepl (and run) have the workspace as their cwd by design. The typical use of file() is for another process to use them as input, which is why they get downloaded into a temporary sandbox (and are placed in the lmdb_store). Just to clarify my understanding: it sounds like you don’t actually need the files in a sandbox at all? You just want them in the workspace all along? Your solution sounds reasonable for that, with the caveat that I’m not sure what happens if you delete a symlink. Do things invalidate properly for you in that case?happy-kitchen-89482
12/10/2024, 8:47 PMgifted-lunch-20593
12/15/2024, 12:00 AMgifted-lunch-20593
12/15/2024, 12:02 AMhappy-kitchen-89482
12/15/2024, 2:29 AM