Nathan
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
I got it to work.
The complication is that the paths in the Marimo
.py
file header are relative to the command line, not the file itself. So for this:
This does not work:
But this does:
I was expecting that the paths to be relative to the file itself, not the current directory of the command running it. Is there a spec on the behavior?27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
llm_from_scratch
shouldn't be added as a dependency
Because DataLoader
spawns separate processes and can't access the Dataset
that it needs from within a Marimo notebook cell function, I need to move that class into its own file and somehow a notebook needs to import modules from the local directory. As far as I know Python doesn't have a way to import a bare file (it needs the __init__.py
marker file making the directory contents modules). Is there another preferred way?27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
@Akshay With the github repo and mentioned branches, this should be reproducable. Any thoughts?
27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
I had ran
uv add --script .\llm_from_scratch\appx_a\listing_A_part_2.py ./
and uv add --script .\llm_from_scratch\appx_a\listing_A_part_2.py torch==2.4.1+cu121 --index-url https://download.pytorch.org/whl/cu121
to populate the /// script
header of the .py
file, and then had to manually add the extra-index-url
option.27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
Also, I think I've hit a dead-end on getting it to run with
marimo edit --sandbox
. I'm getting the following error:
To me this says the target file is copied somewhere by itself so there's no possibility of using shared code in the project folder. You can see this attempt here: https://github.com/ngbrown/build-llm-from-scratch/commit/8fccd4a9d422bfe1085d2f2f7bcb57c69cfee98927 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
I was running with
marimo edit
but the error wasn't copyable. There was something in the middle that interrupted the selection. So that's why I pasted the error from the command line.27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
Now I'm trying to figure out
uv
and what is the right thing to keep it compatible with marimo edit --sandbox
.27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
This commit is how I resolved it: https://github.com/ngbrown/build-llm-from-scratch/commit/a72f3fcf7626719fe71acbbd6f238ac607ae06e6
27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
See the
marimo-use-custom-dataloader
branch here: https://github.com/ngbrown/build-llm-from-scratch/tree/marimo-use-custom-dataloader/llm_from_scratch/appx_a/listing_A_part_2.py27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
What would help is the ability to scaffold out a Python directory with a template that puts users on some sort of happy path for what they will need in the future. This would be helpful especially because there so many options around what can be done in Python with hacking the path, etc.. I've seen this sort of thing in the JavaScript community with
npm init react-app my-app
, but can't say I've seen it in Python.27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
This also doesn't seem to be compatible with Marimo's sandbox feature?
27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
I got my project directory to be self-installed as an editable module and moved the
ToyDataset
class into its own file and imported from there, so I can move on. It is kinda a pain to setup the pyproject.toml
and the editable install just for that.27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
27 replies
Mmarimo
•Created by Nathan on 9/29/2024 in #help-support
`DataLoader` with `num_workers=1` crashes?
This is the exception thrown when running from the command line. Same exception happens in the web notebook.
27 replies