{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "JeByetuw4Z8p", "outputId": "40f3df96-0ef2-4c83-fc7b-869868ec4084" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: huggingface_hub in /usr/local/lib/python3.11/dist-packages (0.27.1)\n", "Requirement already satisfied: pandas in /usr/local/lib/python3.11/dist-packages (2.2.2)\n", "Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from huggingface_hub) (3.16.1)\n", "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub) (2024.10.0)\n", "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub) (24.2)\n", "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub) (6.0.2)\n", "Requirement already satisfied: requests in /usr/local/lib/python3.11/dist-packages (from huggingface_hub) (2.32.3)\n", "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub) (4.67.1)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub) (4.12.2)\n", "Requirement already satisfied: numpy>=1.23.2 in /usr/local/lib/python3.11/dist-packages (from pandas) (1.26.4)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/dist-packages (from pandas) (2.8.2)\n", "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.11/dist-packages (from pandas) (2024.2)\n", "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.11/dist-packages (from pandas) (2024.2)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/dist-packages (from python-dateutil>=2.8.2->pandas) (1.17.0)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub) (3.4.1)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub) (3.10)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub) (2.3.0)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub) (2024.12.14)\n" ] } ], "source": [ "!pip install huggingface_hub pandas" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 17, "referenced_widgets": [ "e8ce03452a074d9eb6728e087b368ed2", "35a027d34b45414ab1e0fa02e3c963ef", "51eda975a89e40368e9044b035c78ea4", "8806ac65c1224312a0a86e795ee68c48", "9eee0d24c4be474c8e49f9d5430f6e5f", "a572131b41c7411480c2d077b74bf4d6", "8f386f5b3b5a4b2fa03cc8c8b8160140", "2bb9207c214c4124a4137158206face6", "f025709bcf164d3b9f72a17211a4cb76", "0622e8c7a97b4f63b2583792dd5c6714", "a21ad5d9130e4760b3915ebc9aa35e19", "53bf7541ee9044c3bcb85ca5011d071b", "f66914590b174c2e92ed57f4e4bc383d", "ac0f255d5f4f49339125a8d5d2b89ad6", "358d0a2e351e480885f208925aa88ba7", "7de0479f56c343498e1f1c1441932462", "45e4ef83c5e94aed9da14b534f3d2e0c", "0d8748823faf49d2be43a206532b56e4", "cc4b3c4870b547d68ce204ba2fd73522", "416def283eb841da8e4fb66cb175942c" ] }, "id": "-KBQcoiuz-0C", "outputId": "42e0f573-5d8c-486a-ac22-87fb7bdebe5f" }, "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "VBox(children=(HTML(value='
\n", " | Input | \n", "Output | \n", "LANG | \n", "type | \n", "subject_name | \n", "topic; | \n", "subject | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "Write a python function to find the index of s... | \n", "import math \\r\\ndef find_Index(n): \\r\\n x =... | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
1 | \n", "Post mortem staining gets fixed after - ### A)... | \n", "D | \n", "en | \n", "NaN | \n", "Forensic Medicine | \n", "NaN | \n", "NaN | \n", "
2 | \n", "In our daily life, many of us feel stressed mo... | \n", "A | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
3 | \n", "the average of thirteen numbers is 9 . the ave... | \n", "To find the middle number, we can first calcul... | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
4 | \n", "They took the cure at the spring rather than t... | \n", "B | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
33767 | \n", "यदि $x = X$ और $y = 15$ है, तो $(x - y)(x + y)... | \n", "10 | \n", "hi | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
33768 | \n", "इस संशोधन के राष्ट्रीय राजधानी क्षेत्र के भविष... | \n", "इस संशोधन के राष्ट्रीय राजधानी क्षेत्र के भविष... | \n", "hi | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
33769 | \n", "FFather was a hardworking man who delivered br... | \n", "B | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
33770 | \n", "कोलकाता के लिए 5-दिन की यात्रा योजना:\\n\\n**दिन... | \n", "दिन 1: विक्टोरिया मेमोरियल, सेंट पॉल का कैथेड्... | \n", "hi | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
33771 | \n", "सभी मान खोजें $x > 4$ जो संतुष्ट करते हैं\\n\\[\\... | \n", "दी गई समीकरण से,\\n\\[\\sqrt{x + 4 \\sqrt{x - 4}} ... | \n", "hi | \n", "Intermediate Algebra | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
33772 rows × 7 columns
\n", "Step | \n", "Training Loss | \n", "
---|---|
1000 | \n", "1.083200 | \n", "
2000 | \n", "1.000300 | \n", "
"
],
"text/plain": [
" "
]
},
"metadata": {}
}
],
"source": [
"trainer_stats = trainer.train()"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "xj6XdJWNF6Pb"
},
"source": [
"#**MODEL SAVING**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ULl7losCFj9L"
},
"outputs": [],
"source": [
"!wait"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "cEGk9Cm1FmoH"
},
"outputs": [],
"source": [
"if True: model.push_to_hub_merged(\"DrishtiSharma/HINDI-GEMMA-9B-A60\", tokenizer, save_method = \"merged_16bit\")\n",
"# USE YOU HF ACCOUNT AND NOT THE ORG\n",
"# NAME FORMAT : HINDI-MODELNAME-EXTENSION-A/B-00 - USE A/B is BENCHMARK DATASETS WERE SET TO TRUE/FALSE IN FLAGS , THE NUMBER IS THE RATIO USED ABOVE"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "U5gGbbSNF1oB"
},
"outputs": [],
"source": [
"# SET THE REPO PRIVATE AFTER UPLOAD\n",
"# UPLOAD THE CSV TO THE REPO AFTER IT IS MADE PRIVATE\n",
"# CSV >> THE CSV SAVED IN YOUR RUNTIME"
]
},
{
"cell_type": "code",
"source": [
"from google.colab import runtime\n",
"runtime.unassign()"
],
"metadata": {
"id": "brN9DtmHhYPS"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "3BcP1kfkhcFb"
},
"execution_count": null,
"outputs": []
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"gpuType": "A100",
"machine_shape": "hm",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"e8ce03452a074d9eb6728e087b368ed2": {
"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": [],
"layout": "IPY_MODEL_8f386f5b3b5a4b2fa03cc8c8b8160140"
}
},
"35a027d34b45414ab1e0fa02e3c963ef": {
"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_2bb9207c214c4124a4137158206face6",
"placeholder": "",
"style": "IPY_MODEL_f025709bcf164d3b9f72a17211a4cb76",
"value": "\n",
" \n",
"
\n",
" \n",
" \n",
" \n",
" Step \n",
" Training Loss \n",
" \n",
" \n",
" 1000 \n",
" 1.083200 \n",
" \n",
" \n",
" \n",
"2000 \n",
" 1.000300 \n",
"
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.