Skip to content

Commit bc2e455

Browse files
author
张俊杰
committed
词向量服务修改为GPU更新
1 parent 33b8e0d commit bc2e455

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

service/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def ImgToVector(self, request, context):
2525

2626
def TextToVector(self, textRequest, context):
2727
text_embedding = work.forward({'text': textRequest.Content})['text_embedding']
28-
print(textRequest.Content)
28+
text_embedding = text_embedding.cpu() # 将张量复制到主机内存
2929
numpy_array = text_embedding.numpy()
3030
np.set_printoptions(suppress=True)
3131
array_string = np.array2string(numpy_array, separator=',')

0 commit comments

Comments
 (0)