CentOS 运行bert模型

    xiaoxiao2022-07-12  158

    1.安装python3

    2.安装TensorFlow     (CPU)

    python -m pip install tensorflow

    或 TensorFlow GPU

    3.如果直接运行shell报错,没有glibc 2.23

    可以参照下记博客:https://blog.csdn.net/f0UiRe/article/details/88736755

    centos7.2 升级 glibc 至 2.23

    4.运行shell,启动服务成功

    CPU运行成功的结果

    5.通过python代码调用

    from bert_base.client import BertClient def gets(text=''): print('start================') bc = BertClient(ip="192.168.1.25") vec = bc.encode(['大连','辽宁']) print(vec) return str('a') gets()

     

    最新回复(0)