From f2a5e7eaa4c21e670f5c4e28bd4d727fafc71064 Mon Sep 17 00:00:00 2001 From: Trevor Nogues Date: Thu, 16 May 2024 14:30:31 -0700 Subject: [PATCH] update import paths --- examples/test_model.ipynb | 8 +- examples/train_model.ipynb | 1013 +++++++++++++++++++++++++++++++++++- 2 files changed, 1009 insertions(+), 12 deletions(-) diff --git a/examples/test_model.ipynb b/examples/test_model.ipynb index 7357583..31566a5 100644 --- a/examples/test_model.ipynb +++ b/examples/test_model.ipynb @@ -11,7 +11,7 @@ "import os\n", "import sys\n", "\n", - "dir_path = os.path.dirname(os.path.realpath(\"./\")) + \"/fair_housing_guardrail\"\n", + "dir_path = os.path.dirname(os.path.realpath(\"./\"))\n", "\n", "if dir_path not in sys.path:\n", " sys.path.insert(1, dir_path)" @@ -26,8 +26,8 @@ "source": [ "import pandas as pd\n", "\n", - "from utils.helper import load_config, load_dataset, load_tokenizer\n", - "from utils.fair_housing_classification import FairHousingGuardrailClassification" + "from fair_housing_guardrail.utils.helper import load_config, load_dataset, load_tokenizer\n", + "from fair_housing_guardrail.utils.fair_housing_classification import FairHousingGuardrailClassification" ] }, { @@ -81,7 +81,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.9.16" } }, "nbformat": 4, diff --git a/examples/train_model.ipynb b/examples/train_model.ipynb index aa4b540..d123069 100644 --- a/examples/train_model.ipynb +++ b/examples/train_model.ipynb @@ -12,7 +12,7 @@ "import os\n", "import sys\n", "\n", - "dir_path = os.path.dirname(os.path.realpath(\"./\")) + \"/fair_housing_guardrail\"\n", + "dir_path = os.path.dirname(os.path.realpath(\"./\"))\n", "\n", "if dir_path not in sys.path:\n", " sys.path.insert(1, dir_path)" @@ -29,9 +29,9 @@ "import pandas as pd\n", "import plotly.graph_objects as go\n", "\n", - "from data.json_dataset import JsonDataset\n", - "from utils.helper import load_config, load_dataset, load_tokenizer\n", - "from utils.fair_housing_classification import FairHousingGuardrailClassification" + "from fair_housing_guardrail.data.json_dataset import JsonDataset\n", + "from fair_housing_guardrail.utils.helper import load_config, load_dataset, load_tokenizer\n", + "from fair_housing_guardrail.utils.fair_housing_classification import FairHousingGuardrailClassification" ] }, { @@ -49,10 +49,1004 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "ae3ca773-d14d-464a-8532-aae8a8dfcb2c", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'loss': 0.4724, 'grad_norm': 8.26887035369873, 'learning_rate': 2.0000000000000003e-06, 'epoch': 4.0}\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "78de7303e5c349ac984504b4658d46ad", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + " 0%| | 0/2 [00:00