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