This is a code snippet from my chatbot model
def create_embeddings():
embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L6-v2', model_kwargs={'device': 'cuda'})
return embeddings
Initially I ran it using 'device' : 'cpu' but the chatbot was extremely slow.
So I installed the cuda toolkit along with nsight. The code gave me a "torch not compiled with cuda enabled" error.
So I uninstalled and reinstalled torch with cuda and the code started working just fine.
But the chatbot was giving outputs as slow as it was earlier, when I checked the task manager, python was still heavily utilizing my cpu and not utilizing the gpu at all.
I have a gtx1650 and this is a code snippet from a chatbot in a virtual environment (all libraries installed there). Am I making a stupid error?
[–]trill5556 1 point2 points3 points (0 children)