Skip to content

Commit

Permalink
exclude notebooks from linting
Browse files Browse the repository at this point in the history
  • Loading branch information
masci committed Oct 6, 2024
1 parent c125cd0 commit 9e5e784
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 36 deletions.
83 changes: 47 additions & 36 deletions cookbooks/Prompt_Versioning.ipynb
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Prompt versioning\n",
"\n",
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/masci/banks/blob/main/cookbooks/Prompt_Versioning.ipynb\">\n",
" <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -27,19 +24,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "iCSH4kOaczt5"
},
"outputs": [],
"source": [
"import os\n",
"\n",
"os.mkdir(\"templates\")"
],
"metadata": {
"id": "iCSH4kOaczt5"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "UaSSFjnUXzMD"
},
"outputs": [],
"source": [
"from pathlib import Path\n",
"\n",
Expand All @@ -64,15 +66,15 @@
"# tell them apart.\n",
"registry.set(name=\"blog_prompt\", prompt=blog_prompt_gpt, version=\"gpt-3.5-turbo\")\n",
"registry.set(name=\"blog_prompt\", prompt=blog_prompt_llama3, version=\"ollama/llama3.1:8b\")"
],
"metadata": {
"id": "UaSSFjnUXzMD"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "IyVpMFN7dAhW"
},
"outputs": [],
"source": [
"import os\n",
"\n",
Expand All @@ -88,15 +90,24 @@
"\n",
"\n",
"response = completion(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[{ \"content\": registry.get(name=\"blog_prompt\", version=\"gpt-3.5-turbo\").text(), \"role\": \"user\"}]\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[{\"content\": registry.get(name=\"blog_prompt\", version=\"gpt-3.5-turbo\").text(), \"role\": \"user\"}],\n",
")"
],
"metadata": {
"id": "IyVpMFN7dAhW"
},
"execution_count": null,
"outputs": []
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
]
}
},
"nbformat": 4,
"nbformat_minor": 0
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ only-include = ["src/banks", "src/templates"]
[tool.ruff]
target-version = "py39"
line-length = 120
exclude = ["cookbooks"]
[tool.ruff.lint]
select = [
"A",
Expand Down

0 comments on commit 9e5e784

Please sign in to comment.