{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"gpu","dataSources":[{"sourceId":59575,"databundleVersionId":8060720,"sourceType":"competition"},{"sourceId":5111,"sourceType":"modelInstanceVersion","isSourceIdPinned":true,"modelInstanceId":3899}],"dockerImageVersionId":30699,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"Published on April 29, 2024. By Marília Prata, mpwolke","metadata":{}},{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nimport plotly.graph_objs as go\nimport plotly.offline as py\nimport plotly.express as px\n\n#Ignore warnings\nimport warnings\nwarnings.filterwarnings('ignore')\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_kg_hide-input":true,"_kg_hide-output":true,"execution":{"iopub.status.busy":"2024-04-29T19:42:27.793339Z","iopub.execute_input":"2024-04-29T19:42:27.793675Z","iopub.status.idle":"2024-04-29T19:42:32.323074Z","shell.execute_reply.started":"2024-04-29T19:42:27.793646Z","shell.execute_reply":"2024-04-29T19:42:32.321907Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Réduisez le parquet à 100 lignes, en essayant de le rendre plus rapide et plus facile.\n\nReduce to 100 rows, trying to make it faster and easier.","metadata":{}},{"cell_type":"code","source":"#By StackOverflow https://stackoverflow.com/questions/53982871/pandas-reading-first-n-rows-from-parquet-file\n\nfrom pyarrow.parquet import ParquetFile\nimport pyarrow as pa \n\npf = ParquetFile('../input/uspto-explainable-ai/patent_data/2013_12.parquet') \nfirst_hundred_rows = next(pf.iter_batches(batch_size = 100)) \ndf = pa.Table.from_batches([first_hundred_rows]).to_pandas()","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:49:45.052550Z","iopub.execute_input":"2024-04-29T18:49:45.052897Z","iopub.status.idle":"2024-04-29T18:49:48.463057Z","shell.execute_reply.started":"2024-04-29T18:49:45.052867Z","shell.execute_reply":"2024-04-29T18:49:48.462070Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.tail()","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:09:34.469563Z","iopub.execute_input":"2024-04-29T18:09:34.470108Z","iopub.status.idle":"2024-04-29T18:09:34.491083Z","shell.execute_reply.started":"2024-04-29T18:09:34.470071Z","shell.execute_reply":"2024-04-29T18:09:34.490204Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['title'][98]","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:12:36.615179Z","iopub.execute_input":"2024-04-29T18:12:36.615712Z","iopub.status.idle":"2024-04-29T18:12:36.659354Z","shell.execute_reply.started":"2024-04-29T18:12:36.615677Z","shell.execute_reply":"2024-04-29T18:12:36.658484Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['title'][95]","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:15:22.102118Z","iopub.execute_input":"2024-04-29T18:15:22.102563Z","iopub.status.idle":"2024-04-29T18:15:22.111716Z","shell.execute_reply.started":"2024-04-29T18:15:22.102533Z","shell.execute_reply":"2024-04-29T18:15:22.109934Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Installer Transformers, Bitsandbytes","metadata":{}},{"cell_type":"code","source":"!pip install -q -U transformers\n!pip install -q -U accelerate\n!pip install -q -U bitsandbytes","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2024-04-29T18:50:14.706399Z","iopub.execute_input":"2024-04-29T18:50:14.706849Z","iopub.status.idle":"2024-04-29T18:51:08.396659Z","shell.execute_reply.started":"2024-04-29T18:50:14.706820Z","shell.execute_reply":"2024-04-29T18:51:08.395479Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Installer Langchain","metadata":{}},{"cell_type":"code","source":"!pip install -q -U langchain","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2024-04-29T18:51:14.728517Z","iopub.execute_input":"2024-04-29T18:51:14.729299Z","iopub.status.idle":"2024-04-29T18:51:32.609223Z","shell.execute_reply.started":"2024-04-29T18:51:14.729264Z","shell.execute_reply":"2024-04-29T18:51:32.608093Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\nimport torch\nfrom time import time\nfrom transformers import AutoTokenizer, AutoModelForCausalLM, pipeline\nfrom transformers import pipeline\nfrom langchain.llms import HuggingFacePipeline\nfrom langchain.chains import LLMChain, SimpleSequentialChain\nfrom langchain import PromptTemplate","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:51:50.178791Z","iopub.execute_input":"2024-04-29T18:51:50.179606Z","iopub.status.idle":"2024-04-29T18:52:07.401955Z","shell.execute_reply.started":"2024-04-29T18:51:50.179549Z","shell.execute_reply":"2024-04-29T18:52:07.401055Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\nmodel_id = '/kaggle/input/mistral/pytorch/7b-v0.1-hf/1'\ntime_1 = time()\ntokenizer = AutoTokenizer.from_pretrained(model_id)\nmodel_name = AutoModelForCausalLM.from_pretrained(\n        model_id,\n        torch_dtype=torch.bfloat16,\n        device_map=\"auto\",\n        trust_remote_code=True,\n    )\nprint(f\"Tokenizer & pipeline: {round(time() - time_1)} sec.\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:52:14.217370Z","iopub.execute_input":"2024-04-29T18:52:14.218337Z","iopub.status.idle":"2024-04-29T18:54:50.903917Z","shell.execute_reply.started":"2024-04-29T18:52:14.218305Z","shell.execute_reply":"2024-04-29T18:54:50.902951Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Tester le modèle\n\nTest model\n\nLet's test the model","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntime_1 = time()\nquery_pipeline = pipeline(\n        \"text-generation\",\n        model=model_name,\n        tokenizer=tokenizer,\n        do_sample=True,\n        top_k=50,\n        top_p=0.95,\n        temperature=0.1,\n        num_return_sequences=1,\n        eos_token_id=tokenizer.eos_token_id,\n        torch_dtype=torch.float16,\n        device_map=\"auto\",\n        max_length=200,)\ntime_2 = time()\nprint(f\"Prepare pipeline: {round(time_2-time_1, 3)} sec.\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:54:57.467593Z","iopub.execute_input":"2024-04-29T18:54:57.467952Z","iopub.status.idle":"2024-04-29T18:54:57.475651Z","shell.execute_reply.started":"2024-04-29T18:54:57.467924Z","shell.execute_reply":"2024-04-29T18:54:57.474601Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Définir une fonction pour tester le pipeline de requêtes\n\nDefine a function to test the query pipeline","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ndef test_model(tokenizer, pipeline, prompt_to_test):\n    \"\"\"\n    Perform a query\n    print the result\n    Args:\n        tokenizer: the tokenizer\n        pipeline: the pipeline\n        prompt_to_test: the prompt\n    Returns\n        None\n    \"\"\"\n    # adapted from https://huggingface.co/blog/llama2#using-transformers\n    time_1 = time()\n    sequences = pipeline(\n        prompt_to_test,\n        do_sample=True,\n        top_k=50,\n        top_p=0.95,\n        temperature=0.1,\n        num_return_sequences=1,\n        eos_token_id=tokenizer.eos_token_id,\n        max_length=200,)\n    time_2 = time()\n    print(f\"Test inference: {round(time_2-time_1, 3)} sec.\")\n    for seq in sequences:\n        print(f\"Result: {seq['generated_text']}\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:55:03.268153Z","iopub.execute_input":"2024-04-29T18:55:03.268875Z","iopub.status.idle":"2024-04-29T18:55:03.275058Z","shell.execute_reply.started":"2024-04-29T18:55:03.268844Z","shell.execute_reply":"2024-04-29T18:55:03.274204Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Avoid RuntimeError: cutlassF: no kernel found to launch! ADD that below\n\ntorch.backends.cuda.enable_mem_efficient_sdp(False)\ntorch.backends.cuda.enable_flash_sdp(False)\n\nAdding the above two lines, to disable Scaled Dot Product(SDP) related enhancements helped.\n\nAnswered by Amulya https://www.kaggle.com/discussions/product-feedback/471939","metadata":{}},{"cell_type":"code","source":"#Answered by Amulya  https://www.kaggle.com/discussions/product-feedback/471939\n#To avoid RuntimeError: cutlassF: no kernel found to launch!\n\ntorch.backends.cuda.enable_mem_efficient_sdp(False)\ntorch.backends.cuda.enable_flash_sdp(False)","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:57:59.392491Z","iopub.execute_input":"2024-04-29T18:57:59.392848Z","iopub.status.idle":"2024-04-29T18:57:59.397631Z","shell.execute_reply.started":"2024-04-29T18:57:59.392819Z","shell.execute_reply":"2024-04-29T18:57:59.396562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Opérateur de recherche booléen Ou (\"Or\") \n\nBoolean search operator \"OR\"","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Were Hydraulic Circuits OR Soot Sensor US Patents published?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:58:05.056893Z","iopub.execute_input":"2024-04-29T18:58:05.057271Z","iopub.status.idle":"2024-04-29T18:58:14.082706Z","shell.execute_reply.started":"2024-04-29T18:58:05.057242Z","shell.execute_reply":"2024-04-29T18:58:14.081665Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Opérateur de recherche booléen ET (+)\n\nBoolean search operator AND (+)","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Hydraulic Circuits AND Soot Sensor Patents were published?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:58:21.298573Z","iopub.execute_input":"2024-04-29T18:58:21.298947Z","iopub.status.idle":"2024-04-29T18:58:30.098433Z","shell.execute_reply.started":"2024-04-29T18:58:21.298917Z","shell.execute_reply":"2024-04-29T18:58:30.097451Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Mon parquet était 2013_12_parquet (décembre 2013).\n\nMy parquet was 2013_12-parquet (December 2013). \n\nNot the dates provided above. ","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Hydraulic Circuits Patents + Soot Sensor Patents were published?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:58:51.093244Z","iopub.execute_input":"2024-04-29T18:58:51.093598Z","iopub.status.idle":"2024-04-29T18:58:59.789836Z","shell.execute_reply.started":"2024-04-29T18:58:51.093571Z","shell.execute_reply":"2024-04-29T18:58:59.788930Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Opérateur \"PROCHE\" (NEAR)\n\nOperator \"NEAR","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Hydraulic Circuits Patents NEAR Energy Conservation were published?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T18:59:16.495383Z","iopub.execute_input":"2024-04-29T18:59:16.495748Z","iopub.status.idle":"2024-04-29T18:59:25.305088Z","shell.execute_reply.started":"2024-04-29T18:59:16.495718Z","shell.execute_reply":"2024-04-29T18:59:25.304059Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Opérateur \"NON\" (-)\n\nOperator \"NOT\" (-)","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Hydraulic Circuits Patents NOT Publication number: US-2013318959-A1?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:00:05.074680Z","iopub.execute_input":"2024-04-29T19:00:05.075048Z","iopub.status.idle":"2024-04-29T19:00:13.253663Z","shell.execute_reply.started":"2024-04-29T19:00:05.075003Z","shell.execute_reply":"2024-04-29T19:00:13.252764Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Hydraulic Circuits Patents - US Patent Publication number: US-2013318959-A1?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:00:21.031838Z","iopub.execute_input":"2024-04-29T19:00:21.032209Z","iopub.status.idle":"2024-04-29T19:00:29.092206Z","shell.execute_reply.started":"2024-04-29T19:00:21.032179Z","shell.execute_reply":"2024-04-29T19:00:29.091244Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Soot Sensor Patents - US Patent Publication number: US-2013318948-A1?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:00:58.080738Z","iopub.execute_input":"2024-04-29T19:00:58.081582Z","iopub.status.idle":"2024-04-29T19:01:06.335779Z","shell.execute_reply.started":"2024-04-29T19:00:58.081549Z","shell.execute_reply":"2024-04-29T19:01:06.334865Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Opérateur \"ADJ\" (Adjacent)\n\nOperator \"ADJ\" (Adjacente)","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Soot Sensor Patent ADJ Publication number: US-2013318948-A1?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:01:11.230857Z","iopub.execute_input":"2024-04-29T19:01:11.231600Z","iopub.status.idle":"2024-04-29T19:01:19.566197Z","shell.execute_reply.started":"2024-04-29T19:01:11.231565Z","shell.execute_reply":"2024-04-29T19:01:19.565264Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#why the model is asking about \"catalytic converter\"? I didn't mentioned that.","metadata":{}},{"cell_type":"markdown","source":"#Opérateur \"Idem\" (SAME)\n\nOperator \"Same\"","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Soot Sensor Patent Publication number: US-2013318948-A1 SAME title?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:01:26.178527Z","iopub.execute_input":"2024-04-29T19:01:26.179159Z","iopub.status.idle":"2024-04-29T19:01:34.471895Z","shell.execute_reply.started":"2024-04-29T19:01:26.179130Z","shell.execute_reply":"2024-04-29T19:01:34.470998Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Operator \"With\"","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\ntest_model(tokenizer,\n           query_pipeline,\n           \"Hydraulic Circuits Patent WITH Energy Conservation?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:01:40.424346Z","iopub.execute_input":"2024-04-29T19:01:40.425148Z","iopub.status.idle":"2024-04-29T19:01:49.354431Z","shell.execute_reply.started":"2024-04-29T19:01:40.425119Z","shell.execute_reply":"2024-04-29T19:01:49.353488Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Row 98 (US-2013318959-A1) is Hydraulic circuits WITH Energy Conservation ","metadata":{}},{"cell_type":"markdown","source":"#HuggingFacePipeline","metadata":{}},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\nllm = HuggingFacePipeline(pipeline=query_pipeline)","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:01:54.786838Z","iopub.execute_input":"2024-04-29T19:01:54.787717Z","iopub.status.idle":"2024-04-29T19:01:54.793222Z","shell.execute_reply.started":"2024-04-29T19:01:54.787684Z","shell.execute_reply":"2024-04-29T19:01:54.792171Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"llm(\"Hydraulic Circuits AND Soot Sensor Patents were published?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:02:00.379539Z","iopub.execute_input":"2024-04-29T19:02:00.380365Z","iopub.status.idle":"2024-04-29T19:02:04.437376Z","shell.execute_reply.started":"2024-04-29T19:02:00.380327Z","shell.execute_reply":"2024-04-29T19:02:04.436416Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#I've just changed AND to +  Just to check how it will show on the output","metadata":{}},{"cell_type":"code","source":"llm(\"Hydraulic Circuits Patents + Soot Sensor Patents?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:02:23.829308Z","iopub.execute_input":"2024-04-29T19:02:23.829682Z","iopub.status.idle":"2024-04-29T19:02:32.636274Z","shell.execute_reply.started":"2024-04-29T19:02:23.829653Z","shell.execute_reply":"2024-04-29T19:02:32.635314Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"llm(\"Hydraulic Circuits Patents NEAR Energy Conservation published?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:02:35.747515Z","iopub.execute_input":"2024-04-29T19:02:35.748202Z","iopub.status.idle":"2024-04-29T19:02:44.593188Z","shell.execute_reply.started":"2024-04-29T19:02:35.748168Z","shell.execute_reply":"2024-04-29T19:02:44.592268Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"llm(\"Soot Sensor Patents NOT Publication number: US-2013318948-A1?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:04:12.960397Z","iopub.execute_input":"2024-04-29T19:04:12.961080Z","iopub.status.idle":"2024-04-29T19:04:21.378461Z","shell.execute_reply.started":"2024-04-29T19:04:12.961048Z","shell.execute_reply":"2024-04-29T19:04:21.377581Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"llm(\"Hydraulic Circuits Patents WITH Energy Conservation?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:06:29.703905Z","iopub.execute_input":"2024-04-29T19:06:29.704755Z","iopub.status.idle":"2024-04-29T19:06:38.638006Z","shell.execute_reply.started":"2024-04-29T19:06:29.704723Z","shell.execute_reply":"2024-04-29T19:06:38.637059Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Gabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model\n\nllm(\"Hydraulic Circuits Patents ADJ Energy Conservation?\")","metadata":{"execution":{"iopub.status.busy":"2024-04-29T19:03:02.630367Z","iopub.execute_input":"2024-04-29T19:03:02.630748Z","iopub.status.idle":"2024-04-29T19:03:11.534070Z","shell.execute_reply.started":"2024-04-29T19:03:02.630721Z","shell.execute_reply":"2024-04-29T19:03:11.533131Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Acknowledgements:\n\nGabriel Preda https://www.kaggle.com/code/gpreda/multiple-task-chain-with-mistral-model","metadata":{}}]}