4.9 KiB
4.9 KiB
In [ ]:
!pip install embedchainIn [ ]:
!pip install embedchain[dataloaders]In [ ]:
!pip install --upgrade embedchain[opensource]In [ ]:
from embedchain import Pipeline as AppIn [ ]:
config = """
llm:
provider: gpt4all
config:
model: 'orca-mini-3b.ggmlv3.q4_0.bin'
temperature: 0.5
max_tokens: 1000
top_p: 1
stream: false
embedder:
provider: gpt4all
config:
model: 'all-MiniLM-L6-v2'
"""
# Write the multi-line string to a YAML file
with open('gpt4all.yaml', 'w') as file:
file.write(config)In [ ]:
app = App.from_config(yaml_path="gpt4all.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)