2024-05-05 23:07:04 +00:00
|
|
|
from langchain_community.llms import Ollama
|
|
|
|
from langchain_community.document_loaders import WebBaseLoader
|
2023-08-09 18:49:22 +00:00
|
|
|
from langchain.chains.summarize import load_summarize_chain
|
|
|
|
|
2024-02-09 23:19:30 +00:00
|
|
|
loader = WebBaseLoader("https://ollama.com/blog/run-llama2-uncensored-locally")
|
2023-08-09 18:49:22 +00:00
|
|
|
docs = loader.load()
|
|
|
|
|
2024-05-05 23:07:04 +00:00
|
|
|
llm = Ollama(model="llama3")
|
2023-08-09 18:49:22 +00:00
|
|
|
chain = load_summarize_chain(llm, chain_type="stuff")
|
|
|
|
|
2024-05-05 23:07:04 +00:00
|
|
|
result = chain.invoke(docs)
|
2023-08-09 18:49:22 +00:00
|
|
|
print(result)
|