Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from langchain import PromptTemplate, LLMChain
|
3 |
from langchain.llms import GPT4All
|
4 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
@@ -33,7 +34,7 @@ def func(user):
|
|
33 |
# callbacks = [StreamingStdOutCallbackHandler()]
|
34 |
|
35 |
# Verbose is required to pass to the callback manager
|
36 |
-
llm =
|
37 |
llm_chain = LLMChain(prompt=prompt, llm=llm)
|
38 |
question = user
|
39 |
llm_chain.run(question)
|
|
|
1 |
import gradio as gr
|
2 |
+
from langchain.llms import LlamaCpp
|
3 |
from langchain import PromptTemplate, LLMChain
|
4 |
from langchain.llms import GPT4All
|
5 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
|
|
34 |
# callbacks = [StreamingStdOutCallbackHandler()]
|
35 |
|
36 |
# Verbose is required to pass to the callback manager
|
37 |
+
llm = LlamaCpp(model_path="./nous-hermes-13b.ggmlv3.q4_0.bin", n_ctx=2048)
|
38 |
llm_chain = LLMChain(prompt=prompt, llm=llm)
|
39 |
question = user
|
40 |
llm_chain.run(question)
|