TurboTransformers icon indicating copy to clipboard operation
TurboTransformers copied to clipboard

请问怎么用tensorflow加载bert呢?

Open qiuxia-alone opened this issue 4 years ago • 1 comments

你好,请问用tensorflow加载bert,是先将bert权重转成npz格式,再用from_npz 加载么?from_torchfrom_pretrained应该都都是加载的pytorch模型,不知道我理解得对不对?另外,请问gpt2现在还只能用onnx加速么?

qiuxia-alone avatar Oct 20 '21 11:10 qiuxia-alone

  1. 你理解没错,tf需要转化为npz加载,torch则可以直接加载。
  2. gpt2只能用onnxrt加速

feifeibear avatar Oct 21 '21 02:10 feifeibear