From a3accf81c9fdbeda29c000e08135f753e566d8f8 Mon Sep 17 00:00:00 2001 From: Maziyar Panahi Date: Wed, 13 Mar 2024 11:01:47 +0100 Subject: [PATCH 1/3] revert the change in tfFile naming - revert the change introduced in https://github.com/JohnSnowLabs/spark-nlp/pull/14130 --- .../classifier/dl/XlmRoBertaForQuestionAnswering.scala | 2 +- .../classifier/dl/XlmRoBertaForSequenceClassification.scala | 2 +- .../classifier/dl/XlmRoBertaForTokenClassification.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala index 3cb512d56195b9..b885f640d94145 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala @@ -306,7 +306,7 @@ trait ReadXlmRoBertaForQuestionAnsweringDLModel with ReadSentencePieceModel { this: ParamsAndFeaturesReadable[XlmRoBertaForQuestionAnswering] => - override val tfFile: String = "xlm_roberta_classification_tf" + override val tfFile: String = "xlm_roberta_classification_tensorflow" override val onnxFile: String = "xlm_roberta_classification_onnx" override val sppFile: String = "xlmroberta_spp" diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala index 8f9f12c5a2af8f..366b0ce0fa8ad6 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala @@ -357,7 +357,7 @@ trait ReadXlmRoBertaForSequenceDLModel with ReadSentencePieceModel { this: ParamsAndFeaturesReadable[XlmRoBertaForSequenceClassification] => - override val tfFile: String = "xlm_roberta_classification_tf" + override val tfFile: String = "xlm_roberta_classification_tensorflow" override val onnxFile: String = "xlm_roberta_classification_onnx" override val sppFile: String = "xlmroberta_spp" diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala index 2f5328583a2712..f9f933c1f8d018 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala @@ -328,7 +328,7 @@ trait ReadXlmRoBertaForTokenDLModel with ReadSentencePieceModel { this: ParamsAndFeaturesReadable[XlmRoBertaForTokenClassification] => - override val tfFile: String = "xlm_roberta_classification_tf" + override val tfFile: String = "xlm_roberta_classification_tensorflow" override val onnxFile: String = "xlm_roberta_classification_onnx" override val sppFile: String = "xlmroberta_spp" From 7e5d33e7a325a995f9180ac078b4c58fd27bda8b Mon Sep 17 00:00:00 2001 From: ahmedlone127 Date: Sun, 17 Mar 2024 03:46:29 +0500 Subject: [PATCH 2/3] renaming tf file name in reading --- .../classifier/dl/XlmRoBertaForQuestionAnswering.scala | 2 +- .../classifier/dl/XlmRoBertaForSequenceClassification.scala | 2 +- .../classifier/dl/XlmRoBertaForTokenClassification.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala index b885f640d94145..bd508a4d7b1a9f 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala @@ -319,7 +319,7 @@ trait ReadXlmRoBertaForQuestionAnsweringDLModel instance.getEngine match { case TensorFlow.name => val tfWrapper = - readTensorflowModel(path, spark, "xlm_roberta_classification_tf", initAllTables = false) + readTensorflowModel(path, spark, "xlm_roberta_classification_tensorflow", initAllTables = false) instance.setModelIfNotSet(spark, Some(tfWrapper), None, spp) case ONNX.name => val onnxWrapper = diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala index 366b0ce0fa8ad6..782cbd01ed5be3 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala @@ -370,7 +370,7 @@ trait ReadXlmRoBertaForSequenceDLModel instance.getEngine match { case TensorFlow.name => val tfWrapper = - readTensorflowModel(path, spark, "xlm_roberta_classification_tf", initAllTables = false) + readTensorflowModel(path, spark, "xlm_roberta_classification_tensorflow", initAllTables = false) instance.setModelIfNotSet(spark, Some(tfWrapper), None, spp) case ONNX.name => val onnxWrapper = diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala index f9f933c1f8d018..2f6cbed1db5f5a 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala @@ -342,7 +342,7 @@ trait ReadXlmRoBertaForTokenDLModel instance.getEngine match { case TensorFlow.name => val tfWrapper = - readTensorflowModel(path, spark, "xlm_roberta_classification_tf", initAllTables = false) + readTensorflowModel(path, spark, "xlm_roberta_classification_tensorflow", initAllTables = false) instance.setModelIfNotSet(spark, Some(tfWrapper), None, spp) case ONNX.name => val onnxWrapper = From ba16ce2f2c8dd0ffc10cba15dc2db08d9ad21833 Mon Sep 17 00:00:00 2001 From: ahmedlone127 Date: Sun, 17 Mar 2024 03:47:55 +0500 Subject: [PATCH 3/3] Revert "renaming tf file name in reading" This reverts commit 7e5d33e7a325a995f9180ac078b4c58fd27bda8b. --- .../classifier/dl/XlmRoBertaForQuestionAnswering.scala | 2 +- .../classifier/dl/XlmRoBertaForSequenceClassification.scala | 2 +- .../classifier/dl/XlmRoBertaForTokenClassification.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala index bd508a4d7b1a9f..b885f640d94145 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForQuestionAnswering.scala @@ -319,7 +319,7 @@ trait ReadXlmRoBertaForQuestionAnsweringDLModel instance.getEngine match { case TensorFlow.name => val tfWrapper = - readTensorflowModel(path, spark, "xlm_roberta_classification_tensorflow", initAllTables = false) + readTensorflowModel(path, spark, "xlm_roberta_classification_tf", initAllTables = false) instance.setModelIfNotSet(spark, Some(tfWrapper), None, spp) case ONNX.name => val onnxWrapper = diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala index 782cbd01ed5be3..366b0ce0fa8ad6 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForSequenceClassification.scala @@ -370,7 +370,7 @@ trait ReadXlmRoBertaForSequenceDLModel instance.getEngine match { case TensorFlow.name => val tfWrapper = - readTensorflowModel(path, spark, "xlm_roberta_classification_tensorflow", initAllTables = false) + readTensorflowModel(path, spark, "xlm_roberta_classification_tf", initAllTables = false) instance.setModelIfNotSet(spark, Some(tfWrapper), None, spp) case ONNX.name => val onnxWrapper = diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala index 2f6cbed1db5f5a..f9f933c1f8d018 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/XlmRoBertaForTokenClassification.scala @@ -342,7 +342,7 @@ trait ReadXlmRoBertaForTokenDLModel instance.getEngine match { case TensorFlow.name => val tfWrapper = - readTensorflowModel(path, spark, "xlm_roberta_classification_tensorflow", initAllTables = false) + readTensorflowModel(path, spark, "xlm_roberta_classification_tf", initAllTables = false) instance.setModelIfNotSet(spark, Some(tfWrapper), None, spp) case ONNX.name => val onnxWrapper =