4.6 KiB
4.6 KiB
In [ ]:
!pip install embedchainIn [ ]:
!pip install embedchain[llama2]In [ ]:
import os
from embedchain import App
os.environ["OPENAI_API_KEY"] = "sk-xxx"
os.environ["REPLICATE_API_TOKEN"] = "xxx"In [ ]:
config = """
llm:
provider: llama2
config:
model: 'a16z-infra/llama13b-v2-chat:df7690f1994d94e96ad9d568eac121aecf50684a0b0963b25a41cc40061269e5'
temperature: 0.5
max_tokens: 1000
top_p: 0.5
stream: false
"""
# Write the multi-line string to a YAML file
with open('llama2.yaml', 'w') as file:
file.write(config)In [ ]:
app = App.from_config(yaml_path="llama2.yaml")In [ ]:
app.add("https://www.forbes.com/profile/elon-musk")In [ ]:
while(True):
question = input("Enter question: ")
if question in ['q', 'exit', 'quit']:
break
answer = app.query(question)
print(answer)