captain-awesome commited on
Commit
66b8021
1 Parent(s): 67ad565

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -5,6 +5,7 @@ from langchain.llms import HuggingFacePipeline
5
  from langchain import PromptTemplate
6
  from langchain.embeddings import HuggingFaceEmbeddings
7
  from langchain.text_splitter import RecursiveCharacterTextSplitter
 
8
  from langchain.vectorstores import Chroma
9
  from langchain.document_loaders import (
10
  CSVLoader,
@@ -109,7 +110,8 @@ def load_model():
109
  # # temperature=temperature, # type: ignore
110
  # )
111
  llm = CTransformers(
112
- model="TheBloke/Llama-2-7B-Chat-GGML"
 
113
  # model_type=model_type,
114
  # max_new_tokens=max_new_tokens, # type: ignore
115
  # temperature=temperature, # type: ignore
 
5
  from langchain import PromptTemplate
6
  from langchain.embeddings import HuggingFaceEmbeddings
7
  from langchain.text_splitter import RecursiveCharacterTextSplitter
8
+ from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
9
  from langchain.vectorstores import Chroma
10
  from langchain.document_loaders import (
11
  CSVLoader,
 
110
  # # temperature=temperature, # type: ignore
111
  # )
112
  llm = CTransformers(
113
+ model="TheBloke/Llama-2-7B-Chat-GGML",
114
+ callbacks=[StreamingStdOutCallbackHandler()]
115
  # model_type=model_type,
116
  # max_new_tokens=max_new_tokens, # type: ignore
117
  # temperature=temperature, # type: ignore