Skip to content

Commit

Permalink
Add invoke example to LLaMA2 function template notebook (#12437)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlancemartin authored Oct 27, 2023
1 parent 0ca539e commit 68e12d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion templates/llama2-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ By default, it will extract the title and author of papers.

## LLM

This template will use `Replicate` [hosted version](https://replicate.com/andreasjansson/llama-2-13b-chat-gguf) of LLaMA.
This template will use a `Replicate` [hosted version](https://replicate.com/andreasjansson/llama-2-13b-chat-gguf) of LLaMA2 that has support for grammars and jsonschema.

Based on the `Replicate` example, these are supplied directly in the prompt.

Be sure that `REPLICATE_API_TOKEN` is set in your environment.
5 changes: 4 additions & 1 deletion templates/llama2-functions/llama2-functions.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "9faf648c-541e-4368-82a8-96287dbf34de",
"metadata": {},
Expand All @@ -23,6 +24,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "67306dbd-d79c-4723-825e-7d88edb811ba",
"metadata": {},
Expand All @@ -43,7 +45,8 @@
"outputs": [],
"source": [
"from langserve.client import RemoteRunnable\n",
"llama2_function = RemoteRunnable('http://0.0.0.0:8001/llama2_functions')"
"llama2_function = RemoteRunnable('http://0.0.0.0:8001/llama2_functions')\n",
"llama2_function.invoke({\"input\":text[0].page_content[0:1500]})"
]
}
],
Expand Down

0 comments on commit 68e12d3

Please sign in to comment.