diff --git a/Generative Models/Advanced Mistral 7B LLM Chatbot/Flask/templates/app.py b/Generative Models/Advanced Mistral 7B LLM Chatbot/Flask/templates/app.py
new file mode 100644
index 00000000..5cefc378
--- /dev/null
+++ b/Generative Models/Advanced Mistral 7B LLM Chatbot/Flask/templates/app.py
@@ -0,0 +1,22 @@
+from flask import Flask, render_template, request, jsonify
+from chat import chatbot
+
+app = Flask(__name__)
+
+
+@app.route("/")
+def hello():
+ return render_template('chat.html')
+
+@app.route("/ask", methods=['POST'])
+def ask():
+
+ message = str(request.form['messageText'])
+
+ bot_response = chatbot(message)
+
+ return jsonify({'status':'OK','answer':bot_response})
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/Generative Models/Advanced Mistral 7B LLM Chatbot/Flask/templates/chat.html b/Generative Models/Advanced Mistral 7B LLM Chatbot/Flask/templates/chat.html
new file mode 100644
index 00000000..80d5852f
--- /dev/null
+++ b/Generative Models/Advanced Mistral 7B LLM Chatbot/Flask/templates/chat.html
@@ -0,0 +1,160 @@
+
+
+
+
+ "],"text/html":["\n"," \n"," \n","
\n"," [250/250 22:51, Epoch 0/1]\n","
\n"," \n"," \n"," \n"," Step | \n"," Training Loss | \n","
\n"," \n"," \n"," \n"," 100 | \n"," 1.479000 | \n","
\n"," \n"," 200 | \n"," 1.248000 | \n","
\n"," \n","
"]},"metadata":{}},{"output_type":"execute_result","data":{"text/plain":["TrainOutput(global_step=250, training_loss=1.3423775177001953, metrics={'train_runtime': 1383.1959, 'train_samples_per_second': 1.446, 'train_steps_per_second': 0.181, 'total_flos': 309533448536064.0, 'train_loss': 1.3423775177001953, 'epoch': 0.4})"]},"metadata":{},"execution_count":1}],"source":["import torch\n","from datasets import load_dataset, Dataset\n","from peft import LoraConfig, AutoPeftModelForCausalLM, prepare_model_for_kbit_training, get_peft_model\n","from transformers import AutoModelForCausalLM, AutoTokenizer, GPTQConfig, TrainingArguments\n","from trl import SFTTrainer\n","import os\n","\n","data = load_dataset(\"tatsu-lab/alpaca\", split=\"train\")\n","data_df = data.to_pandas()\n","data_df = data_df[:5000]\n","data_df[\"text\"] = data_df[[\"input\", \"instruction\", \"output\"]].apply(lambda x: \"###Human: \" + x[\"instruction\"] + \" \" + x[\"input\"] + \" ###Assistant: \"+ x[\"output\"], axis=1)\n","data = Dataset.from_pandas(data_df)\n","\n","\n","tokenizer = AutoTokenizer.from_pretrained(\"TheBloke/Mistral-7B-Instruct-v0.1-GPTQ\")\n","tokenizer.pad_token = tokenizer.eos_token\n","\n","\n","quantization_config_loading = GPTQConfig(bits=4, disable_exllama=True, tokenizer=tokenizer)\n","model = AutoModelForCausalLM.from_pretrained(\n"," \"TheBloke/Mistral-7B-Instruct-v0.1-GPTQ\",\n"," quantization_config=quantization_config_loading,\n"," device_map=\"auto\"\n"," )\n","\n","\n","model.config.use_cache=False\n","model.config.pretraining_tp=1\n","model.gradient_checkpointing_enable()\n","model = prepare_model_for_kbit_training(model)\n","\n","\n","peft_config = LoraConfig(\n"," r=16, lora_alpha=16, lora_dropout=0.05, bias=\"none\", task_type=\"CAUSAL_LM\", target_modules=[\"q_proj\", \"v_proj\"]\n",")\n","model = get_peft_model(model, peft_config)\n","\n","\n","training_arguments = TrainingArguments(\n"," output_dir=\"mistral-finetuned-alpaca\",\n"," per_device_train_batch_size=8,\n"," gradient_accumulation_steps=1,\n"," optim=\"paged_adamw_32bit\",\n"," learning_rate=2e-4,\n"," lr_scheduler_type=\"cosine\",\n"," save_strategy=\"epoch\",\n"," logging_steps=100,\n"," num_train_epochs=1,\n"," max_steps=250,\n"," fp16=True,\n"," push_to_hub=True\n",")\n","\n","\n","trainer = SFTTrainer(\n"," model=model,\n"," train_dataset=data,\n"," peft_config=peft_config,\n"," dataset_text_field=\"text\",\n"," args=training_arguments,\n"," tokenizer=tokenizer,\n"," packing=False,\n"," max_seq_length=512\n",")\n","\n","\n","trainer.train()"]},{"cell_type":"code","source":["! cp -r /content/mistral-finetuned-alpaca /content/drive/MyDrive/"],"metadata":{"id":"2C0J_lvpETlx"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["# Inference"],"metadata":{"id":"xNGTJHf8loC-"}},{"cell_type":"code","source":["from google.colab import drive\n","drive.mount('/content/drive')"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"PAwdjd_Yg0n9","executionInfo":{"status":"ok","timestamp":1696731867090,"user_tz":-330,"elapsed":21152,"user":{"displayName":"VASANTH P","userId":"10391598464000680670"}},"outputId":"6838c997-3477-4298-cdf1-cd91bef00fd8"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["Mounted at /content/drive\n"]}]},{"cell_type":"code","source":["from peft import AutoPeftModelForCausalLM\n","from transformers import GenerationConfig\n","from transformers import AutoTokenizer\n","import torch\n","tokenizer = AutoTokenizer.from_pretrained(\"/content/mistral-finetuned-alpaca\")\n","\n","inputs = tokenizer(\"\"\"###Human: Why mobile is bad for human? ###Assistant: \"\"\", return_tensors=\"pt\").to(\"cuda\")"],"metadata":{"id":"5F2TaEJdrMb4","colab":{"base_uri":"https://localhost:8080/"},"outputId":"f030b2c7-237a-4081-8af6-cc5ae45dbd00","executionInfo":{"status":"ok","timestamp":1696731905373,"user_tz":-330,"elapsed":342,"user":{"displayName":"VASANTH P","userId":"10391598464000680670"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stderr","text":["Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"]}]},{"cell_type":"code","source":["model = AutoPeftModelForCausalLM.from_pretrained(\n"," \"/content/mistral-finetuned-alpaca\",\n"," low_cpu_mem_usage=True,\n"," return_dict=True,\n"," torch_dtype=torch.float16,\n"," device_map=\"cuda\")"],"metadata":{"id":"oXWdyFH07pkS"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["generation_config = GenerationConfig(\n"," do_sample=True,\n"," top_k=1,\n"," temperature=0.1,\n"," max_new_tokens=100,\n"," pad_token_id=tokenizer.eos_token_id\n",")"],"metadata":{"id":"8CUitmUL7GzZ"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["import time\n","st_time = time.time()\n","outputs = model.generate(**inputs, generation_config=generation_config)\n","print(tokenizer.decode(outputs[0], skip_special_tokens=True))\n","print(time.time()-st_time)"],"metadata":{"id":"k2xZ0HX_sHZ6","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1696731934910,"user_tz":-330,"elapsed":12562,"user":{"displayName":"VASANTH P","userId":"10391598464000680670"}},"outputId":"f1072119-716f-4f63-a581-733ea429b628"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["###Human: Why mobile is bad for human? ###Assistant: 1. Mobile devices can be addictive and lead to a sedentary lifestyle.\n","2. Mobile devices can be harmful to mental health, causing anxiety and depression.\n","3. Mobile devices can be harmful to physical health, causing eye strain and headaches.\n","4. Mobile devices can be harmful to social relationships, causing people to become isolated and disconnected from others.\n","5. Mobile devices can be harmful to privacy, as they can track users' location and personal information.\n","\n","12.296765804290771\n"]}]},{"cell_type":"code","source":[],"metadata":{"id":"MfDUrykTlehI"},"execution_count":null,"outputs":[]}],"metadata":{"accelerator":"GPU","colab":{"provenance":[{"file_id":"1PStReD70FLxBLaxwOITePjv8dFX0CdBo","timestamp":1696671802254},{"file_id":"1-w2BaBxrydS5XKfPGfrKioctma78Sl15","timestamp":1695942887421}],"gpuType":"T4"},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"name":"python"},"widgets":{"application/vnd.jupyter.widget-state+json":{"f1402ec61b2a493db4f9fbc21d6b3cf2":{"model_module":"@jupyter-widgets/controls","model_name":"VBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"VBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"VBoxView","box_style":"","children":["IPY_MODEL_8a664505719d40618ef7b5342a0a4b27","IPY_MODEL_b3dc2d64611e4f81a12bd52540b98cd0","IPY_MODEL_d0d97423dd7b484aa7f85eedcb703254","IPY_MODEL_3909b24f4e9445108afeca2b3c4829c6"],"layout":"IPY_MODEL_8fef569859b44fc58f0e472855a2cfb3"}},"5845378d6a5e47ec99b9ed51ce3da08e":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_e408fda1b6d047a795555b853d8da15b","placeholder":"","style":"IPY_MODEL_d14ab7031eaa48a28c8266b42bc9ddd7","value":"
Copy a token from your Hugging Face\ntokens page and paste it below.
Immediately click login after copying\nyour token or it might be stored in plain text in this notebook file. "}},"b0fe6b3b4a6648b198f710cf0a1dafdd":{"model_module":"@jupyter-widgets/controls","model_name":"PasswordModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"PasswordModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"PasswordView","continuous_update":true,"description":"Token:","description_tooltip":null,"disabled":false,"layout":"IPY_MODEL_77282984ad5942948ca91fac762d3782","placeholder":"","style":"IPY_MODEL_cbb9aa2e7b474bea8e820369afdfc69d","value":""}},"161aa3aa074a43f9adaa4c974b79672c":{"model_module":"@jupyter-widgets/controls","model_name":"CheckboxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"CheckboxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"CheckboxView","description":"Add token as git credential?","description_tooltip":null,"disabled":false,"indent":true,"layout":"IPY_MODEL_72cb2b2952cd4d6f820ff44566afff7a","style":"IPY_MODEL_9c001b62e1734754a39766e921dfd39b","value":true}},"4eb677845caa4a1e8a80e4fb28c141ad":{"model_module":"@jupyter-widgets/controls","model_name":"ButtonModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ButtonModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ButtonView","button_style":"","description":"Login","disabled":false,"icon":"","layout":"IPY_MODEL_62cba932d5e04a879de45ca01bed21b8","style":"IPY_MODEL_8ce7fdc20404488da7429c3baa8869cc","tooltip":""}},"eb10188e7e744da5b47e50b7b7a504e9":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_ea527461be434c1e8bd75f84f9cd0848","placeholder":"","style":"IPY_MODEL_f70d1a342ac942978314d64dc2f5bec6","value":"\nPro Tip: If you don't already have one, you can create a dedicated\n'notebooks' token with 'write' access, that you can then easily reuse for all\nnotebooks. "}},"8fef569859b44fc58f0e472855a2cfb3":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":"center","align_self":null,"border":null,"bottom":null,"display":"flex","flex":null,"flex_flow":"column","grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":"50%"}},"e408fda1b6d047a795555b853d8da15b":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"d14ab7031eaa48a28c8266b42bc9ddd7":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"77282984ad5942948ca91fac762d3782":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"cbb9aa2e7b474bea8e820369afdfc69d":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"72cb2b2952cd4d6f820ff44566afff7a":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"9c001b62e1734754a39766e921dfd39b":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"62cba932d5e04a879de45ca01bed21b8":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"8ce7fdc20404488da7429c3baa8869cc":{"model_module":"@jupyter-widgets/controls","model_name":"ButtonStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ButtonStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","button_color":null,"font_weight":""}},"ea527461be434c1e8bd75f84f9cd0848":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f70d1a342ac942978314d64dc2f5bec6":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"b3ace92302844dcf84a7718e06556f02":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_65a13b1109614d43a31f8bc75212b2b8","placeholder":"","style":"IPY_MODEL_2400ba6ca6ff4f39b6218f77d6d52ddb","value":"Connecting..."}},"65a13b1109614d43a31f8bc75212b2b8":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"2400ba6ca6ff4f39b6218f77d6d52ddb":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"8a664505719d40618ef7b5342a0a4b27":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_5f65e8bdf1574824b66b45bbb3e4894c","placeholder":"","style":"IPY_MODEL_22e1e59027cd44f88acb2f5c29f2cbdf","value":"Token is valid (permission: write)."}},"b3dc2d64611e4f81a12bd52540b98cd0":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_6699de6ced1f43919ce9e2a15b17fc69","placeholder":"","style":"IPY_MODEL_048fa829e579417abc06e749d9404c79","value":"Your token has been saved in your configured git credential helpers (store)."}},"d0d97423dd7b484aa7f85eedcb703254":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_ec8dd7408fc44a5dbf46401fc5993f4b","placeholder":"","style":"IPY_MODEL_39996229275a46798842ccd92e04408a","value":"Your token has been saved to /root/.cache/huggingface/token"}},"3909b24f4e9445108afeca2b3c4829c6":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_2c47ad9177114dab815f474b79bfcb83","placeholder":"","style":"IPY_MODEL_9c79bda15e454bd5a058a946dcee32ba","value":"Login successful"}},"5f65e8bdf1574824b66b45bbb3e4894c":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"22e1e59027cd44f88acb2f5c29f2cbdf":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"6699de6ced1f43919ce9e2a15b17fc69":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"048fa829e579417abc06e749d9404c79":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"ec8dd7408fc44a5dbf46401fc5993f4b":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"39996229275a46798842ccd92e04408a":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"2c47ad9177114dab815f474b79bfcb83":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"9c79bda15e454bd5a058a946dcee32ba":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"5981cb40ef464de292611a516b0e1ced":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_83cd236211b44b57b799f85ba8961bd7","IPY_MODEL_5ddd9fa6fad14b6cbcb80310fa07d810","IPY_MODEL_468ebfcbed774e2a8a75b76452dacfe1"],"layout":"IPY_MODEL_cd13f44bb203414593ad06ab80391dd7"}},"83cd236211b44b57b799f85ba8961bd7":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_7a829e9ccb4d49c2bf2e1ab16a15b5ee","placeholder":"","style":"IPY_MODEL_205d7ca4f9324c2f85b7f31e3a5e3120","value":"Map: 100%"}},"5ddd9fa6fad14b6cbcb80310fa07d810":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_fc0e61f5db5d49b2825894782d25d4ef","max":5000,"min":0,"orientation":"horizontal","style":"IPY_MODEL_df4c60c77309425b950e6787982762a0","value":5000}},"468ebfcbed774e2a8a75b76452dacfe1":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_966597c0e9814b33a90dba172788d50a","placeholder":"","style":"IPY_MODEL_9961639b515144389da5e4ff8918533e","value":" 5000/5000 [00:01<00:00, 4398.10 examples/s]"}},"cd13f44bb203414593ad06ab80391dd7":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"7a829e9ccb4d49c2bf2e1ab16a15b5ee":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"205d7ca4f9324c2f85b7f31e3a5e3120":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"fc0e61f5db5d49b2825894782d25d4ef":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"df4c60c77309425b950e6787982762a0":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"966597c0e9814b33a90dba172788d50a":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"9961639b515144389da5e4ff8918533e":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}}}}},"nbformat":4,"nbformat_minor":0}
diff --git a/Generative Models/Advanced Mistral 7B LLM Chatbot/README.md b/Generative Models/Advanced Mistral 7B LLM Chatbot/README.md
new file mode 100644
index 00000000..0097f64f
--- /dev/null
+++ b/Generative Models/Advanced Mistral 7B LLM Chatbot/README.md
@@ -0,0 +1,40 @@
+# Mistral LLM Chatbot
+
+Mistral LLM is a language model developed by Mistral AI. It is a large language model designed to understand and generate human-like text. LLM stands for "Large Language Model," indicating its size and capabilities.
+
+Mistral 7B is a specific model within the Mistral LLM family. The "7B" refers to the number of parameters in the model, with larger numbers generally indicating more powerful and capable models. Mistral 7B is one of the latest models from Mistral AI and is designed to outperform the previous Llama 2 13B model on various benchmarks.
+
+Mistral 7B is trained on a large amount of text data and can be used for a wide range of natural language processing tasks, such as text generation, question answering, language translation, and more. It is designed to understand and generate text in a way that is coherent and contextually relevant.
+
+In this repository, we have used Mistral 7B to create a LLM chatbot:
+
+
+## Introduction
+Mistral LLM is a state-of-the-art language model developed by Mistral AI. It is part of the Large Language Model (LLM) family, designed to generate human-like text based on the input it receives. The Mistral 7B model is specifically optimized for high performance, outperforming previous models like Llama 2 13B in various benchmarks.
+
+This project utilizes Mistral 7B, a cutting-edge language model with 7 billion parameters, to create a highly capable conversational chatbot. The Mistral 7B model can generate natural, contextually relevant responses, making it ideal for a wide range of natural language processing (NLP) tasks, including text generation, question answering, and language translation.
+
+## Key Features:
+Text Generation: Generate coherent and contextually accurate responses.
+Question Answering: Answer questions based on context.
+Multilingual Support: Understand and respond in multiple languages.
+Contextual Understanding: Maintain conversation context over multiple interactions.
+
+
+Pre-trained Mistral 7B model for natural language processing tasks.
+Real-time text generation using the language model.
+Contextual memory: Remembers previous conversation history.
+Fast and scalable deployment, capable of handling multiple user queries.
+
+## Requirements
+To run the Mistral LLM Chatbot, you need to install the following dependencies:
+
+Python 3.8+
+PyTorch (for using the Mistral 7B model)
+Transformers library from Hugging Face
+CUDA (optional, for GPU acceleration)
+
+![mistral1](https://github.com/user-attachments/assets/cfb19f50-5438-4c77-b84b-9e30febfe91e)
+
+
+
diff --git a/Generative Models/Advanced Mistral 7B LLM Chatbot/chatbot temp b/Generative Models/Advanced Mistral 7B LLM Chatbot/chatbot temp
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/Generative Models/Advanced Mistral 7B LLM Chatbot/chatbot temp
@@ -0,0 +1 @@
+