doc enhancement for the inference, prompt engineer, local-cloud

This commit is contained in:
Justin Lee 2024-11-06 11:24:31 -08:00
parent 3c707e0a05
commit e746f741d1
3 changed files with 308 additions and 124 deletions

View file

@ -9,7 +9,7 @@
"\n",
"Prompt engineering is using natural language to produce a desired response from a large language model (LLM).\n",
"\n",
"This interactive guide covers prompt engineering & best practices with Llama 3.1 and Llama Stack.\n",
"This interactive guide covers prompt engineering & best practices with Llama 3.2 and Llama Stack.\n",
"\n",
"Before you begin, please ensure Llama Stack is installed and set up by following the [Getting Started Guide](https://llama-stack.readthedocs.io/en/latest/getting_started/index.html)."
]
@ -41,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "df35d1e2",
"metadata": {},
"outputs": [],
@ -62,14 +62,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "c2a0e359",
"metadata": {},
"outputs": [],
"source": [
"from llama_stack_client import LlamaStackClient\n",
"\n",
"client = LlamaStackClient(base_url='http://{HOST}:{PORT}')"
"client = LlamaStackClient(base_url=f'http://{HOST}:{PORT}')"
]
},
{
@ -84,7 +84,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "da140b33",
"metadata": {},
"outputs": [],
@ -148,7 +148,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "8b321089",
"metadata": {},
"outputs": [],
@ -170,10 +170,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "4ac1ac3e",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[36m> Response: That's Llama!\u001b[0m\n"
]
}
],
"source": [
"from termcolor import cprint\n",
"\n",
@ -191,16 +199,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "524189bd",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[36m> Response: That's Llama!\u001b[0m\n"
]
}
],
"source": [
"from llama_stack_client import LlamaStackClient\n",
"from llama_stack_client.types import CompletionMessage, UserMessage\n",
"from termcolor import cprint\n",
"\n",
"client = LlamaStackClient(base_url='http://{HOST}:{PORT}')\n",
"client = LlamaStackClient(base_url=f'http://{HOST}:{PORT}')\n",
"\n",
"response = client.inference.chat_completion(\n",
" messages=[\n",
@ -251,17 +267,25 @@
"\n",
"The next one will be a guide on how to chat with images, continue to the notebook [here](./02_Image_Chat101.ipynb). Happy learning!"
]
},
{
"cell_type": "markdown",
"id": "cce1f624",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python"
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.15"
}
},
"nbformat": 4,