embedchain/notebooks/llama2.ipynb
!pip install embedchain[llama2]
You can find OPENAI_API_KEY on your OpenAI dashboard and REPLICATE_API_TOKEN key on your Replicate dashboard.
import os
from embedchain import App
os.environ["OPENAI_API_KEY"] = "sk-xxx"
os.environ["REPLICATE_API_TOKEN"] = "xxx"
app = App.from_config(config={
"provider": "llama2",
"config": {
"model": "a16z-infra/llama13b-v2-chat:df7690f1994d94e96ad9d568eac121aecf50684a0b0963b25a41cc40061269e5",
"temperature": 0.5,
"max_tokens": 1000,
"top_p": 0.5,
"stream": False
}
})
app.add("https://www.forbes.com/profile/elon-musk")
while(True):
question = input("Enter question: ")
if question in ['q', 'exit', 'quit']:
break
answer = app.query(question)
print(answer)