device='cpu' is not working

#3
by Saracmbr - opened

I'm running code below but I still get the error of torch.cuda.OutOfMemoryError: CUDA out of memory.

doc_emb = l2v.encode(docs_processed[0].page_content,device= 'cpu')
what am I doing wrong in here?

the example
documents = [
"As a general guideline, the CDC's average requirement of protein for women ages 19 to 70 is 46 grams per day. But, as you can see from this chart, you'll need to increase that if you're expecting or training for a marathon. Check out the chart below to see how much protein you should be eating each day.",
"Definition of summit for English Language Learners. : 1 the highest point of a mountain : the top of a mountain. : 2 the highest level. : 3 a meeting or series of meetings between the leaders of two or more governments.",
]
d_reps = l2v.encode(documents)
is working just fine.

tensor([[ 2.4219, -5.0312, 0.9531, ..., -0.6797, -1.3750, -1.3281],
[ 4.1250, -1.3750, -1.4922, ..., 3.1562, 0.7500, -1.6250]])

Sign up or log in to comment