You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FIXED] Kaggle notebook: No module named 'unsloth' #566
I encountered the same error. It was functioning correctly until last week, but when I attempted install it on the kaggle notebook today, the error occured.
I also encountered the following:---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[7], line 1
----> 1 from unsloth import FastLanguageModel
2 import torch
3 max_seq_length = 2048 # Choose any! We auto support RoPE Scaling internally!
Hmm I think Kaggle is notorious for breaking llama.cpp saves because Kaggle only has 20GB of disk space. My suggestion is to save the LoRA adapters, then use Colab which has like 80GB Disk space to convert to GGUF
Unsloth: Will use up to 20.49 out of 31.36 RAM for saving.
0%| | 0/32 [00:00<?, ?it/s]
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
File /opt/conda/lib/python3.10/site-packages/torch/serialization.py:629, in save(obj, f, pickle_module, pickle_protocol, _use_new_zipfile_serialization, _disable_byteorder_record)
628 with _open_zipfile_writer(f) as opened_zipfile:
--> 629 _save(obj, opened_zipfile, pickle_module, pickle_protocol, _disable_byteorder_record)
630 return
File /opt/conda/lib/python3.10/site-packages/torch/serialization.py:863, in _save(obj, zip_file, pickle_module, pickle_protocol, _disable_byteorder_record)
862 num_bytes = storage.nbytes()
--> 863 zip_file.write_record(name, storage.data_ptr(), num_bytes)
RuntimeError: [enforce fail at inline_container.cc:764] . PytorchStreamWriter failed writing file data/51: file write failed
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
File /opt/conda/lib/python3.10/site-packages/unsloth/save.py:1367, in unsloth_save_pretrained_gguf(self, save_directory, tokenizer, quantization_method, first_conversion, push_to_hub, token, private, is_main_process, state_dict, save_function, max_shard_size, safe_serialization, variant, save_peft_format, tags, temporary_location, maximum_memory_usage)
1366 try:
-> 1367 new_save_directory, old_username = unsloth_save_model(**arguments)
1368 makefile = None
In GGUF / llama.cpp
You can try to push the full model to HF by saving it under a different directory other then /kaggle/output, then use "gguf_converter" space on HF by GGML to convert to gguf.
Activity
Tharun-swi commentedon May 31, 2024
More information about this ERROR:
Collecting shtab>=1.5.6 (from tyro->unsloth@ git+https://github.com/unslothai/unsloth.git->unsloth[kaggle-new]@ git+https://github.com/unslothai/unsloth.git)
Downloading shtab-1.7.1-py3-none-any.whl.metadata (7.3 kB)
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.10/site-packages/aiohttp-3.9.1.dist-info/METADATA'
atishay2411 commentedon May 31, 2024
I encountered the same error. It was functioning correctly until last week, but when I attempted install it on the kaggle notebook today, the error occured.
danielhanchen commentedon May 31, 2024
Oh yep sorry everyone!!! Working on a fix! Sorry again!
MRQJsfhf commentedon Jun 1, 2024
I also encountered the following:---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[7], line 1
----> 1 from unsloth import FastLanguageModel
2 import torch
3 max_seq_length = 2048 # Choose any! We auto support RoPE Scaling internally!
ModuleNotFoundError: No module named 'unsloth'
MRQJsfhf commentedon Jun 1, 2024
And there are also cases where there is no "xformers" module.
danielhanchen commentedon Jun 1, 2024
@atishay2411 @avcode-exe @Tharun-swi @MRQJsfhf Just fixed it!
Please use the latest Kaggle notebooks:
Mistral 7b: https://www.kaggle.com/code/danielhanchen/kaggle-mistral-7b-unsloth-notebook
Llama-3 8b: https://www.kaggle.com/code/danielhanchen/kaggle-llama-3-8b-unsloth-notebook
The Gemma and a nw Phi-3 Medium are still running:
Gemma 7b: https://www.kaggle.com/code/danielhanchen/kaggle-gemma-7b-unsloth-notebook/
To edit notebooks manually, please edit the install cell from
to
ie put
!mamba install --force-reinstall aiohttp -yat the top of the install cell.jamessucla commentedon Jun 1, 2024
Works for me now. Thanks for the quick fix!
atishay2411 commentedon Jun 1, 2024
The version 4 works perfectly fine for me as well, thanks for the quick turnaround @danielhanchen !!
[-]Kaggle notebook: No module named 'unsloth'[/-][+][FIXED] Kaggle notebook: No module named 'unsloth'[/+]avcode-exe commentedon Jun 1, 2024
Works for me too! Thx!
a442509097 commentedon Jun 2, 2024
In GGUF / llama.cpp
danielhanchen commentedon Jun 2, 2024
Hmm I think Kaggle is notorious for breaking llama.cpp saves because Kaggle only has 20GB of disk space. My suggestion is to save the LoRA adapters, then use Colab which has like 80GB Disk space to convert to GGUF
avcode-exe commentedon Jun 2, 2024
You can try to push the full model to HF by saving it under a different directory other then
/kaggle/output, then use "gguf_converter" space on HF by GGML to convert to gguf.