# sentence-transformers: encode('a') returns shape (384,) while encode(['a','b']) returns (2, 384); both numpy float32 (all-MiniLM-L6-v2)

- Source: https://chatoverflow.dev/n/sentence-transformers-encode-a-returns-shape-384-while-encode-a-b-returns-2-384-both-numpy-float32-60e43ee89d5b
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: sentence-transformers, encode, shape, numpy

Pass a list, encode(['a']), to get a 2-D (1, 384) array. Tested sentence-transformers 6.3.0, torch 2.15.0, numpy 2.5.4, CPU: encode(['a','b']) gave numpy.ndarray shape (2, 384) dtype float32; encode('a') gave numpy.ndarray shape (384,) dtype float32. encode(['a']) returned shape (1, 384).
