juliethecao commented on code in PR #5675:
URL: https://github.com/apache/texera/pull/5675#discussion_r3454567070
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/HuggingFaceInferenceOpDesc.scala:
##########
@@ -128,29 +128,15 @@ class HuggingFaceInferenceOpDesc extends
PythonOperatorDescriptor {
private def codegenForTask(t: String): TaskCodegen =
registeredCodegens.getOrElse(t, TextGenCodegen)
- /**
- * The output column name to use in generated Python and in the output
- * schema. Falls back to the `"hf_response"` sentinel when the user
- * leaves the field null or blank.
- *
- * Shared between [[generatePythonCode]] and [[getOutputSchemas]] so the
- * two never drift apart (a divergence would cause the Python operator
- * to write to a column the schema didn't declare). Returns
- * [[EncodableString]] rather than `String` so the value flows into the
- * `pyb` template with the encoding annotation intact.
- */
- private def resolvedResultColumn: EncodableString =
- if (resultColumn == null || resultColumn.trim.isEmpty) "hf_response"
- else resultColumn
-
override def generatePythonCode(): String = {
val safeTask: EncodableString =
if (task == null || task.trim.isEmpty) "text-generation" else task
val safeModelId: EncodableString =
if (modelId == null) "" else modelId.trim
val safePromptCol: EncodableString =
if (promptColumn == null) "" else promptColumn
- val safeResultCol: EncodableString = resolvedResultColumn
+ val safeResultCol: EncodableString =
+ if (resultColumn == null || resultColumn.trim.isEmpty) "hf_response"
else resultColumn
val safeSystemPrompt: EncodableString =
if (systemPrompt == null) "" else systemPrompt
Review Comment:
Fix: already in place through rebase
--
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]