#[Unsloth Docker] Can't import 'FastSentenceTransformer'

22 messages · Page 1 of 1 (latest)

river folio
#

I'm running Docker (WSL2; local; Nvidia 3080 GPU) with the unsloth/unsloth:stable image. When trying to run the embedding fine-tuning notebook (EmbeddingGemma_(300M).ipynb ), I get this error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 from unsloth import FastSentenceTransformer
      3 fourbit_models = [
      4     "unsloth/all-MiniLM-L6-v2",
      5     "unsloth/embeddinggemma-300m",
   (...)     11 
     12 ] # More models at https://huggingface.co/unsloth
     14 model = FastSentenceTransformer.from_pretrained(
     15     model_name = "unsloth/embeddinggemma-300m",
     16     max_seq_length = 1024,   # Choose any for long context!
     17     full_finetuning = False, # [NEW!] We have full finetuning now!
     18 )

ImportError: cannot import name 'FastSentenceTransformer' from 'unsloth' (/opt/conda/lib/python3.11/site-packages/unsloth/__init__.py)

Since the top-level module comes from unsloth, I'm puzzled by the error; surely the docker image has unsloth and its dependencies correctly installed by default? Any suggestions?

Things I'm certain of

  • Nvidia GPU correctly detected and used in Docker
rain lintel
#

pip show unsloth

river folio
# rain lintel can you check unsloth version?
Name: unsloth
Version: 2026.1.2
Summary: 2-5X faster training, reinforcement learning & finetuning
Home-page: http://www.unsloth.ai
Author: Unsloth AI team
Author-email: [email protected]
License-Expression: Apache-2.0
Location: /opt/conda/lib/python3.11/site-packages
Requires: accelerate, bitsandbytes, datasets, diffusers, hf_transfer, huggingface_hub, numpy, packaging, peft, protobuf, psutil, sentencepiece, torch, torchvision, tqdm, transformers, triton, trl, tyro, unsloth_zoo, wheel, xformers
Required-by: 
rain lintel
#

latest is 2026.1.4

#

comes with embedding support

river folio
# rain lintel latest is 2026.1.4

Just pulled the latest image, now seems to be ollama acting up:

unsloth  | 2026-01-23 21:35:45,457 INFO spawned: 'ollama' with pid 357
unsloth  | 2026-01-23 21:35:45,457 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)                                                       
unsloth  | 2026-01-23 21:35:45,462 INFO exited: ollama (exit status 1; not expected)
unsloth  | 2026-01-23 21:35:48,255 INFO spawned: 'ollama' with pid 360                       
unsloth  | 2026-01-23 21:35:48,259 INFO exited: ollama (exit status 1; not expected)
unsloth  | 2026-01-23 21:35:51,262 INFO spawned: 'ollama' with pid 361
unsloth  | 2026-01-23 21:35:51,266 INFO exited: ollama (exit status 1; not expected)
unsloth  | 2026-01-23 21:35:52,266 INFO gave up: ollama entered FATAL state, too many start retries too quickly
#

gonna see if it persists or not

#

Oh, this line has also been persistent, although the notebook server etc don't seem affected:

unsloth  | 2026-01-23 21:35:40,752 CRIT could not write pidfile /var/run/supervisord.pid
#

Might be good to know if it's just me and/or whether it's a missed bug in the image

#

Re-running the embedding notebook:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File /opt/conda/lib/python3.11/site-packages/unsloth_zoo/temporary_patches/utils.py:107
    106 try:
--> 107     from transformers.processing_utils import Unpack
    108     assert \
    109         type(Unpack) is type(t_Unpack), \
    110         "Unsloth: Unpack type changed! Please file a bug report asap!"

File /opt/conda/lib/python3.11/site-packages/transformers/processing_utils.py:75
     74 if is_torch_available():
---> 75     from .modeling_utils import PreTrainedAudioTokenizerBase
     78 logger = logging.get_logger(__name__)
river folio
craggy crater
#

it will be today

#

usually it takes a couple of days after a pypi release is made because we gotta test and resolve dependency conflicts inside the container before we release it

craggy crater
river folio
craggy crater
craggy crater
#

@river folio pull the latest (i just updated the tag):

docker pull unsloth/unsloth:latest
#

should work for you and can do embeddings

#

also fixed ollama issue