公用類別 InterpreterFactory
建構 translateerApi 執行個體的工廠。
已淘汰,請改用 UnderstandingerApi.create 方法。
公用建構函式
公用方法
| InterpreterApi | |
| InterpreterApi | 
繼承的方法
公用建構函式
public InterpreterFactory ()
公用方法
public InterpreterApi InterpreterApi.Options
使用指定的模型和選項建構 InterpreterApi 例項。系統會從檔案載入模型。
參數
| modelFile | 包含預先訓練 TF Lite 模型的檔案。 | 
|---|---|
| 選項 | 一組自訂翻譯行為的選項。 | 
擲回
| IllegalArgumentException | 如果 modelFile 並未編碼有效的 TensorFlow Lite 模型,就會傳回這個值。
 | 
|---|
public InterpreterApi ByteBufferInterpreterApi.Options
使用指定的模型和選項建構 InterpreterApi 例項。模型將從 ByteBuffer 中讀取。
參數
| byteBuffer | 預先訓練的 TF Lite 模型,採用二進位序列化格式。建構 InterpreterApi 執行個體後,請勿修改 ByteBuffer。ByteBuffer 可以是記憶體對應模型檔案的 MappedByteBuffer,或包含模型位元組內容的 nativeOrder() 直接 ByteBuffer。 | 
|---|---|
| 選項 | 一組自訂翻譯行為的選項。 | 
擲回
| IllegalArgumentException | 表示 byteBuffer 不是 MappedByteBuffer 或 nativeOrder 的直接 ByteBuffer。 | 
|---|