update libraries for langchain_community + llama3 changed from llama2 (#4174)

This commit is contained in:
Lord Basil - Automate EVERYTHING 2024-05-05 19:07:04 -04:00 committed by GitHub
parent 942c979232
commit c78bb76a12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,12 +1,12 @@
from langchain.llms import Ollama from langchain_community.llms import Ollama
from langchain.document_loaders import WebBaseLoader from langchain_community.document_loaders import WebBaseLoader
from langchain.chains.summarize import load_summarize_chain from langchain.chains.summarize import load_summarize_chain
loader = WebBaseLoader("https://ollama.com/blog/run-llama2-uncensored-locally") loader = WebBaseLoader("https://ollama.com/blog/run-llama2-uncensored-locally")
docs = loader.load() docs = loader.load()
llm = Ollama(model="llama2") llm = Ollama(model="llama3")
chain = load_summarize_chain(llm, chain_type="stuff") chain = load_summarize_chain(llm, chain_type="stuff")
result = chain.run(docs) result = chain.invoke(docs)
print(result) print(result)