Skip to content

Commit

Permalink
updated PDL notebook
Browse files Browse the repository at this point in the history
Signed-off-by: Mandana Vaziri <[email protected]>
  • Loading branch information
vazirim committed Oct 15, 2024
1 parent 94888cd commit 620e80f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions recipes/PDL/Prompt_Declaration_Language.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@
"id": "9",
"metadata": {},
"source": [
"## Chat Templates\n",
"### A closer look\n",
"\n",
"The first call to the model in the above program submits the following prompt:\n",
"The first call to the model in the above program submits the following prompt (provided the query is `What is APR?`:\n",
"\n",
"```\n",
"<|start_of_role|>system<|end_of_role|>You are Granite, an AI language model developed by IBM in 2024. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior.<|end_of_text|>\n",
Expand Down Expand Up @@ -170,11 +170,8 @@
" TRUTH:\n",
" read: ./ground_truth.txt\n",
"text:\n",
"- \"\\n${ CODE.source_code }\\n\"\n",
"- model: replicate/ibm-granite/granite-20b-code-instruct-8k\n",
" def: EXPLANATION\n",
" input: |\n",
" Here is some info about the location of the function in the repo.\n",
"- |\n",
" Here is some info about the location of the function in the repo.\n",
" repo: \n",
" ${ CODE.repo_info.repo }\n",
" path: ${ CODE.repo_info.path }\n",
Expand All @@ -183,11 +180,13 @@
"\n",
" Explain the following code:\n",
" ```\n",
" ${ CODE.source_code }\n",
" ```\n",
" ${ CODE.source_code }```\n",
"- model: replicate/ibm-granite/granite-20b-code-instruct-8k\n",
" parameters:\n",
" temperature: 0\n",
" def: EXPLANATION\n",
"- |\n",
"\n",
"\n",
" EVALUATION:\n",
" The similarity (Levenshtein) between this answer and the ground truth is:\n",
"- def: EVAL\n",
Expand All @@ -200,7 +199,7 @@
" truth = \"\"\"\n",
" ${ TRUTH }\n",
" \"\"\"\n",
" result = textdistance.levenshtein.normalized_similarity(expl, truth)"
" result = textdistance.levenshtein.normalized_similarity(expl, truth)\n"
]
},
{
Expand Down Expand Up @@ -240,7 +239,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.10"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 620e80f

Please sign in to comment.