Skip to content

Commit

Permalink
[docs] Update import tensorflow model README (#2614)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu committed May 24, 2023
1 parent 1225ec6 commit d718086
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/tensorflow/how_to_import_tensorflow_models_in_DJL.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ Criteria<String[], float[][]> criteria =
.optProgress(new ProgressBar())
.build();

// Make sure TensorFlow engine is loaded before loading extension
Engine.getEngine("TensorFlow");
// Load TensorFlow Text libraries for necessary ops
// Example Path of installation on Linux may look like: /home/<user>/.local/python-3.8.3/lib/python3.8/site-packages/tensorflow_text/
TensorFlow.loadLibrary("<path_to_library_installation>/python/ops/_sentencepiece_tokenizer.so");

// Run the model
try (ZooModel<String[], float[][]> model = criteria.loadModel();
Predictor<String[], float[][]> predictor = model.newPredictor()) {
Expand Down

0 comments on commit d718086

Please sign in to comment.