Now Reading
Utilizing ChatGPT Plugins with LLaMA. Use OpenAI’s chatgpt-retrieval-plugin… | by Sarmad Qadri | Mar, 2023

Utilizing ChatGPT Plugins with LLaMA. Use OpenAI’s chatgpt-retrieval-plugin… | by Sarmad Qadri | Mar, 2023

2023-03-26 10:32:49

LLaMA answering a query concerning the LLaMA paper with the chatgpt-retrieval-plugin. So Meta!

The code that glues the plugin to LLaMA is offered on this repo (we welcome contributions):

lastmile-ai/llama-retrieval-plugin

Step 0: Clone the llama-retrieval-plugin repo

Step 1: Arrange the information retailer

conda env create -f setting.yml
conda activate llama-retrieval-plugin
poetry set up
# In manufacturing use-cases, make certain to arrange the bearer token correctly
export BEARER_TOKEN=test1234
export OPENAI_API_KEY=my_openai_api_key

# We used pinecone for our vector database, however you should utilize a special one
export DATASTORE=pinecone
export PINECONE_API_KEY=my_pinecone_api_key
export PINECONE_ENVIRONMENT=us-east1-gcp
export PINECONE_INDEX=my_pinecone_index_name

poetry run begin

Step 2: Add recordsdata to the information retailer

Authorize utilizing the worth of the BEARER_TOKEN you laid out in Step 1
Specify any PDF file that you simply wish to get chunked into embeddings
{
"queries": [
{
"query": "What is the title of the LLaMA paper?",
"filter": {
"document_id": "f443884b-d137-421e-aac2-9809113ad53d"
},
"top_k": 3
}
]
}
The question API enables you to check out the vector retailer, and configure the filters

Step 3: Arrange LLaMA

Step 4: Use LLaMA to question your customized information

conda activate llama-retrieval-plugin
See Also

# Be certain that the BEARER_TOKEN is about to the identical worth as in Step 1
export BEARER_TOKEN=test1234
# Set the URL to the question endpoint that you simply examined in Step 2
export DATASTORE_QUERY_URL=http://0.0.0.0:8000/question
# Set to the listing the place you've got LLaMA arrange -- akin to the basis of the llama.cpp repo
export LLAMA_WORKING_DIRECTORY=./llama.cpp
python3 llama_with_retrieval.py "What's the title of the LLaMA paper?" 

Step 5: Tweak and experiment

Basis Mannequin Plugin Protocol

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top