Add invoke example to LLaMA2 function template notebook (#12437)

This commit is contained in:
Lance Martin 2023-10-27 10:58:24 -07:00 committed by GitHub
parent 0ca539eb85
commit 68e12d34a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -8,6 +8,8 @@ By default, it will extract the title and author of papers.
## LLM ## 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. Be sure that `REPLICATE_API_TOKEN` is set in your environment.

View File

@ -1,6 +1,7 @@
{ {
"cells": [ "cells": [
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"id": "9faf648c-541e-4368-82a8-96287dbf34de", "id": "9faf648c-541e-4368-82a8-96287dbf34de",
"metadata": {}, "metadata": {},
@ -23,6 +24,7 @@
] ]
}, },
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"id": "67306dbd-d79c-4723-825e-7d88edb811ba", "id": "67306dbd-d79c-4723-825e-7d88edb811ba",
"metadata": {}, "metadata": {},
@ -43,7 +45,8 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"from langserve.client import RemoteRunnable\n", "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]})"
] ]
} }
], ],