{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "JeByetuw4Z8p", "outputId": "943173ff-c77f-4d99-fef1-8be42d7741bb" }, "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": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 17, "referenced_widgets": [ "00e469cfdfcb4a15869a2bb4dc4b143b", "3533f5c716324aaf9dd14322f13d952b", "a4170046417245bba6c13402f16e56e9", "baa8863649ae46dd90a424b954131f81", "dfd7412829c945df890f630f71a81d5b", "7de1017531f24253a7c718798bc52762", "a9dcf075d25e49a3b1e78fa7dec927da", "8e7cb0f4316c485ba2d38b330867fa70", "a10883933fa4450898563771d69c21a8", "7c3246af224c40b08b03cfd63b0ebdff", "4bcb3b10ab3b4747a0619a41b0c3f043", "743e10407eb64de8bbd8da80fd1191c0", "2a22623bd2f047bdbba03a5adebf9f20", "79a5d45e688247b4af48b56f0be41a20", "6d2f15297dee43a9a80bd722e8ade59b", "5c9a77694b904fd2ad01baca262c91c0", "42706d6bb0c745b2b756229716d714d9", "dbe0b3fd792645ecb7e1dda57da64e72", "e32c1c39452b4ace91ac2d992a18b2bc", "e2c867ac1639415a896c328d5473065a" ] }, "id": "-KBQcoiuz-0C", "outputId": "bfb1afec-cdb9-4afd-d58b-a8533024af0a" }, "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", "Sometimes the object module produced by a comp... | \n", "A | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "college_computer_science | \n", "
1 | \n", "चेन्नई में लोकप्रिय व्यंजन कौन से हैं? ### लंब... | \n", "डोसा, इडली, चावल, मिठाई। | \n", "hi | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
2 | \n", "A student has to obtain 60% of the total marks... | \n", "Let's denote the maximum marks as M.\\n\\nTo pas... | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
3 | \n", "Karwar Style Ambade Udid Methi Recipe - Hog Pl... | \n", "To begin making the Karwar Style Ambade Udid M... | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
4 | \n", "How does string theory propose to solve the in... | \n", "String theory proposes to solve the informatio... | \n", "en | \n", "NaN | \n", "NaN | \n", "String theory | \n", "NaN | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
43385 | \n", "What role does tax policy play in the regulati... | \n", "Tax policy plays a significant role in regulat... | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
43386 | \n", "एक पायथन फ़ंक्शन लिखें जो दिए गए ऐरे से सबसे छ... | \n", "def find_First_Missing(array,start,end): \\r\\n ... | \n", "hi | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
43387 | \n", "\"How do gravitational waves affect the orbital... | \n", "Gravitational waves are ripples in the fabric ... | \n", "en | \n", "NaN | \n", "NaN | \n", "Gravitational waves | \n", "NaN | \n", "
43388 | \n", "Plants need iron to grow. What parts of plants... | \n", "A | \n", "en | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
43389 | \n", "Let $a$ and $b$ be positive real numbers such ... | \n", "By AM-HM,\\n\\[\\frac{a + b + b}{3} \\ge \\frac{3}{... | \n", "en | \n", "Intermediate Algebra | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
43390 rows × 7 columns
\n", "Step | \n", "Training Loss | \n", "
---|---|
1000 | \n", "1.162200 | \n", "
2000 | \n", "1.067700 | \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-B10\", 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": {
"00e469cfdfcb4a15869a2bb4dc4b143b": {
"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_a9dcf075d25e49a3b1e78fa7dec927da"
}
},
"3533f5c716324aaf9dd14322f13d952b": {
"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_8e7cb0f4316c485ba2d38b330867fa70",
"placeholder": "",
"style": "IPY_MODEL_a10883933fa4450898563771d69c21a8",
"value": "\n",
" \n",
"
\n",
" \n",
" \n",
" \n",
" Step \n",
" Training Loss \n",
" \n",
" \n",
" 1000 \n",
" 1.162200 \n",
" \n",
" \n",
" \n",
"2000 \n",
" 1.067700 \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.