Spaces:
Runtime error
Runtime error
Debug error inside get_embeddings
Browse files- functions.py +4 -3
functions.py
CHANGED
@@ -44,9 +44,10 @@ def get_embeddings(text):
|
|
44 |
encoded_input = {k: v.to('cuda') for k, v in encoded_input.items()}
|
45 |
model_output = emb_model(**encoded_input)
|
46 |
model_output = model_output.last_hidden_state[:, 0]
|
47 |
-
print(model_output)
|
48 |
-
|
49 |
-
|
|
|
50 |
print(['get_embeddings', 'end'])
|
51 |
return emb_item
|
52 |
|
|
|
44 |
encoded_input = {k: v.to('cuda') for k, v in encoded_input.items()}
|
45 |
model_output = emb_model(**encoded_input)
|
46 |
model_output = model_output.last_hidden_state[:, 0]
|
47 |
+
# print(model_output)
|
48 |
+
# Error: AttributeError: 'numpy.ndarray' object has no attribute 'cpu'
|
49 |
+
# emb_item = model_output.detach().cpu().numpy()[0]
|
50 |
+
# print(emb_item)
|
51 |
print(['get_embeddings', 'end'])
|
52 |
return emb_item
|
53 |
|