RuntimeError: Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method

#101
by andrewzheng1618 - opened

Start cmd: gunicorn --bind=0.0.0.0 --timeout 600 app:app --workers=4 --preload

Initialize BGE M3 like below:
BGE_M3_EMBEDDING_MODEL = BGEM3FlagModel(
os.getenv("BGE_M3_EMBEDDING_MODEL"), use_fp16=True, pooling_method="cls"
)

Sign up or log in to comment