JayYip / m3tl

BERT for Multitask Learning
https://jayyip.github.io/m3tl/
Apache License 2.0
545 stars 125 forks source link

如何进行推理? #91

Open GinkgoX opened 3 years ago

GinkgoX commented 3 years ago

您好,请问训练好的权重可以单独拿出来做成推理服务,提供推理接口吗?

JayYip commented 3 years ago

可以的,具体预测的实现可以参考

https://github.com/JayYip/bert-multitask-learning/blob/d1f7defd6f68f7f45641123eaf295f7620cc46e2/bert_multitask_learning/run_bert_multitask.py#L397

如果要存成SavedModel来推理的话可能需要一些模型改动。