Spaces:
Runtime error
Runtime error
storresbusquets
commited on
Commit
·
d276a98
1
Parent(s):
43c48fb
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def greet(text):
|
4 |
-
|
5 |
from langchain.chat_models import ChatOllama
|
6 |
from langchain.document_loaders import WebBaseLoader
|
7 |
from langchain.chains.summarize import load_summarize_chain
|
8 |
|
9 |
loader = WebBaseLoader("https://lilianweng.github.io/posts/2023-06-23-agent/")
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
from langchain.chains.llm import LLMChain
|
12 |
from langchain.prompts import PromptTemplate
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def greet(text):
|
4 |
+
|
5 |
from langchain.chat_models import ChatOllama
|
6 |
from langchain.document_loaders import WebBaseLoader
|
7 |
from langchain.chains.summarize import load_summarize_chain
|
8 |
|
9 |
loader = WebBaseLoader("https://lilianweng.github.io/posts/2023-06-23-agent/")
|
10 |
+
docs = loader.load()
|
11 |
+
|
12 |
+
llm = ChatOllama(temperature=0, model_name="falcon:7b")
|
13 |
+
chain = load_summarize_chain(llm, chain_type="stuff")
|
14 |
+
|
15 |
+
chain.run(docs)
|
16 |
|
17 |
from langchain.chains.llm import LLMChain
|
18 |
from langchain.prompts import PromptTemplate
|