From cf415c9920dfcfc17fab8c0b509b3ead4dea8da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leticia=20Mart=C3=ADn-Fuertes=20Moreno?= Date: Mon, 25 Mar 2024 12:56:35 +0100 Subject: [PATCH] Add notebooks (#22) Co-authored-by: lmartinfuertes --- docs/source/conf.py | 1 + docs/source/index.rst | 11 +++++++++++ .../source/notebooks}/01_promptmeteo_usage.ipynb | 2 +- .../source/notebooks}/02_model_tuning.ipynb | 2 +- .../source/notebooks}/03_sentiment_analysis.ipynb | 2 +- .../04_test_flant5_classification_prompts.ipynb | 2 +- .../05_test_openai_classification_prompts.ipynb | 2 +- .../notebooks}/06_test_openai_api-generation.ipynb | 2 +- pyproject.toml | 2 ++ 9 files changed, 20 insertions(+), 6 deletions(-) rename {examples => docs/source/notebooks}/01_promptmeteo_usage.ipynb (99%) rename {examples => docs/source/notebooks}/02_model_tuning.ipynb (92%) rename {examples => docs/source/notebooks}/03_sentiment_analysis.ipynb (99%) rename {examples => docs/source/notebooks}/04_test_flant5_classification_prompts.ipynb (99%) rename {examples => docs/source/notebooks}/05_test_openai_classification_prompts.ipynb (99%) rename {examples => docs/source/notebooks}/06_test_openai_api-generation.ipynb (99%) diff --git a/docs/source/conf.py b/docs/source/conf.py index 281d009..8a329dc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,6 +24,7 @@ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', + 'nbsphinx', ] templates_path = ['_templates'] diff --git a/docs/source/index.rst b/docs/source/index.rst index da7bf0b..49c18d6 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -22,3 +22,14 @@ Promptmeteo is a Python library for prompt engineering built over LangChain. It :caption: Classes classes + + +.. toctree:: + :maxdepth: 1 + :caption: Example notebooks + + notebooks/01_promptmeteo_usage + notebooks/03_sentiment_analysis.ipynb + notebooks/04_test_flant5_classification_prompts.ipynb + notebooks/05_test_openai_classification_prompts.ipynb + notebooks/06_test_openai_api-generation.ipynb \ No newline at end of file diff --git a/examples/01_promptmeteo_usage.ipynb b/docs/source/notebooks/01_promptmeteo_usage.ipynb similarity index 99% rename from examples/01_promptmeteo_usage.ipynb rename to docs/source/notebooks/01_promptmeteo_usage.ipynb index 71df782..44c7f9d 100644 --- a/examples/01_promptmeteo_usage.ipynb +++ b/docs/source/notebooks/01_promptmeteo_usage.ipynb @@ -5,7 +5,7 @@ "id": "b559000b-5af7-49ed-8e0a-c9c4765167f0", "metadata": {}, "source": [ - "# Promptmteo Usage - Save and Load Model" + "# Promptmeteo Usage - Save and Load Model" ] }, { diff --git a/examples/02_model_tuning.ipynb b/docs/source/notebooks/02_model_tuning.ipynb similarity index 92% rename from examples/02_model_tuning.ipynb rename to docs/source/notebooks/02_model_tuning.ipynb index 350df6b..bc836ef 100644 --- a/examples/02_model_tuning.ipynb +++ b/docs/source/notebooks/02_model_tuning.ipynb @@ -5,7 +5,7 @@ "id": "9c5befb6-f95f-45f7-872d-6d5d62370880", "metadata": {}, "source": [ - "# Model tuning - Promptmeteo configuration" + "# Model Tuning - Promptmeteo Configuration" ] } ], diff --git a/examples/03_sentiment_analysis.ipynb b/docs/source/notebooks/03_sentiment_analysis.ipynb similarity index 99% rename from examples/03_sentiment_analysis.ipynb rename to docs/source/notebooks/03_sentiment_analysis.ipynb index e07779c..c387b5b 100644 --- a/examples/03_sentiment_analysis.ipynb +++ b/docs/source/notebooks/03_sentiment_analysis.ipynb @@ -5,7 +5,7 @@ "id": "73d808a5-a4dd-4ec5-b4bc-438f1dd5596f", "metadata": {}, "source": [ - "# Sentiment analysis." + "# Sentiment Analysis" ] }, { diff --git a/examples/04_test_flant5_classification_prompts.ipynb b/docs/source/notebooks/04_test_flant5_classification_prompts.ipynb similarity index 99% rename from examples/04_test_flant5_classification_prompts.ipynb rename to docs/source/notebooks/04_test_flant5_classification_prompts.ipynb index b229537..69ef162 100644 --- a/examples/04_test_flant5_classification_prompts.ipynb +++ b/docs/source/notebooks/04_test_flant5_classification_prompts.ipynb @@ -5,7 +5,7 @@ "id": "73d808a5-a4dd-4ec5-b4bc-438f1dd5596f", "metadata": {}, "source": [ - "# Flan-t5-Small Test classification prompts." + "# Flan-t5-Small - Test Classification Prompts" ] }, { diff --git a/examples/05_test_openai_classification_prompts.ipynb b/docs/source/notebooks/05_test_openai_classification_prompts.ipynb similarity index 99% rename from examples/05_test_openai_classification_prompts.ipynb rename to docs/source/notebooks/05_test_openai_classification_prompts.ipynb index fb85aad..f7864a9 100644 --- a/examples/05_test_openai_classification_prompts.ipynb +++ b/docs/source/notebooks/05_test_openai_classification_prompts.ipynb @@ -5,7 +5,7 @@ "id": "73d808a5-a4dd-4ec5-b4bc-438f1dd5596f", "metadata": {}, "source": [ - "# OpenAI test classification prompts." + "# OpenAI - Test Classification Prompts" ] }, { diff --git a/examples/06_test_openai_api-generation.ipynb b/docs/source/notebooks/06_test_openai_api-generation.ipynb similarity index 99% rename from examples/06_test_openai_api-generation.ipynb rename to docs/source/notebooks/06_test_openai_api-generation.ipynb index b2db708..ecb0885 100644 --- a/examples/06_test_openai_api-generation.ipynb +++ b/docs/source/notebooks/06_test_openai_api-generation.ipynb @@ -5,7 +5,7 @@ "id": "73d808a5-a4dd-4ec5-b4bc-438f1dd5596f", "metadata": {}, "source": [ - "# OpenAI test API generation." + "# OpenAI - Test API Generation" ] }, { diff --git a/pyproject.toml b/pyproject.toml index ffed251..5b55693 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,8 @@ docs = [ "furo==2024.1.29", "numpydoc==1.6.0", "sphinxcontrib-napoleon==0.7", + "pandoc==2.3", + "nbsphinx==0.9.3", ] openai = [ "openai==0.27.8",