From b3820dc6e670d89837719c4fd7d304f0f9a0e65e Mon Sep 17 00:00:00 2001 From: bvonodiripsa Date: Tue, 27 Aug 2024 03:55:29 +0000 Subject: [PATCH] More style changes --- ...ributed Question - Answering with LLM on GPU.ipynb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/Explore Algorithms/AI Services/QuickStart - Distributed Question - Answering with LLM on GPU.ipynb b/docs/Explore Algorithms/AI Services/QuickStart - Distributed Question - Answering with LLM on GPU.ipynb index 7ae41e1949..bb9575d250 100644 --- a/docs/Explore Algorithms/AI Services/QuickStart - Distributed Question - Answering with LLM on GPU.ipynb +++ b/docs/Explore Algorithms/AI Services/QuickStart - Distributed Question - Answering with LLM on GPU.ipynb @@ -248,6 +248,7 @@ " except Exception as e:\n", " return str(e)\n", "\n", + "\n", "# Register the function as a UDF\n", "extract_text_udf = udf(extract_text_from_binary_pdf, StringType())\n", "\n", @@ -328,7 +329,11 @@ "# Explode will distribute and replicate the content of a vecor across multple rows\n", "# Add id column\n", "\n", - "exploded_df = splitted_df.select(\"path\", explode(col(\"chunks\")).alias(\"chunk\")).select(\"path\", \"chunk\").withColumn(\"id\", monotonically_increasing_id())" + "exploded_df = (\n", + " splitted_df.select(\"path\", explode(col(\"chunks\")).alias(\"chunk\"))\n", + " .select(\"path\", \"chunk\")\n", + " .withColumn(\"id\", monotonically_increasing_id())\n", + ")" ] }, { @@ -610,7 +615,7 @@ "result_df = (\n", " knn_df.withColumn(\n", " \"zipped\", F.explode(F.arrays_zip(F.col(\"indices\"), F.col(\"distances\")))\n", - " )\n", + " )\n", " .select(\n", " F.col(\"query_id\"),\n", " F.col(\"zipped.indices\").alias(\"id\"),\n", @@ -693,7 +698,7 @@ " print(\"Model is already loaded.\")\n", "else:\n", " print(\"Model is not loaded.\")\n", - " \n", + "\n", " # Extend model input sizes\n", " build_config = BuildConfig()\n", " build_config.plugin_config.context_fmha = True\n",