kz930 commented on code in PR #6809:
URL: https://github.com/apache/texera/pull/6809#discussion_r3634771280
##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/huggingFace/HuggingFaceSentimentAnalysisOpDescSpec.scala:
##########
@@ -130,4 +130,13 @@ class HuggingFaceSentimentAnalysisOpDescSpec extends
AnyFlatSpec with Matchers {
h.resultAttributeNeutral shouldBe "neu"
h.resultAttributeNegative shouldBe "neg"
}
+
+ "HuggingFaceSentimentAnalysisOpDesc.generatePythonCode" should
+ "not import the unused TensorFlow-only symbol" in {
+ // The TF-only symbol was imported but unused; it raises ImportError in a
+ // PyTorch-only transformers install, crashing the generated script.
+ val code = configured().generatePythonCode()
+ code should not include "TFAutoModelForSequenceClassification"
+ code should include("from transformers import
AutoModelForSequenceClassification")
+ }
Review Comment:
Good point — removed the regression test in 4defe25. Kept the import fix
itself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]