Cuda Error with Zero Space

Hello Community,

i developed a local rag pipeline with a model for embeddings, reranking and a LLM for inference. Locally everything works just fine, but I cant get to run it in my zero space.

The Error i get is:
Traceback (most recent call last):
File “/home/user/app/app.py”, line 1, in
import spaces
File “/usr/local/lib/python3.10/site-packages/spaces/init.py”, line 19, in
from .zero.decorator import GPU
File “/usr/local/lib/python3.10/site-packages/spaces/zero/init.py”, line 15, in
raise RuntimeError(
RuntimeError: CUDA has been initialized before importing the spaces package

You can find my space here:

Do you have any hints for me?

Thank you in advance!

2 Likes

Fix seemed to be that I needed to disable CUDA before importing spaces.

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.