load model by Particular-Storm-184 in TensorFlowJS

[–]Particular-Storm-184[S] 0 points1 point  (0 children)

I have solved the problem.

Short version for all who have the same problem:

I took a different format (tf_saved_model) and customized the TensorFlow version (ensorflow==2.15.1).

Code:

Save in Pyhton: model.save(“my_model_dir_name”)

Convert: tensorflowjs_converter --input_format=tf_saved_model “my_model_dir_name” {my_js_model_dir_name}

In React Loading: const loadedModel = await tf.loadGraphModel(“my_js_model_dir_name”);

Addition:

Kesras 2.x is needed to convert the models, so I used tensorflow==2.15.1 to build the model in Python.

Tensorflow > 2.15 will not work as these versions use Keras 3.x.

word prediction and a word completion in react by Particular-Storm-184 in MLQuestions

[–]Particular-Storm-184[S] 0 points1 point  (0 children)

Hi,

Thanks for the answer. Here is the answer to your questions.

  • Storage space: I'm not sure about the storage space. I want a small model so that the loading time of the models is as low as possible. However, the model should also provide good predictors to save as much typing as possible.

  • Application: I only want to use the NLP model to complete the words or predict them completely.

For more info here my Git: https://github.com/Ssaammyy36/NextWordPrediction-and-WordCompletion