Spaces:
Sleeping
Sleeping
gizemsarsinlar
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -128,7 +128,6 @@ chat_prompt = ChatPromptTemplate.from_messages([("system",
|
|
128 |
" (Answer only from retrieval. Only cite sources that are used. Make your response conversational.)"
|
129 |
), ('user', '{input}')])
|
130 |
|
131 |
-
stream_chain = chat_prompt| RPrint() | instruct_llm | StrOutputParser()
|
132 |
|
133 |
def RPrint(preface=""):
|
134 |
"""Simple passthrough "prints, then returns" chain"""
|
@@ -146,6 +145,8 @@ retrieval_chain = (
|
|
146 |
| RPrint()
|
147 |
)
|
148 |
|
|
|
|
|
149 |
def chat_gen(message, history=[], return_buffer=True):
|
150 |
buffer = ""
|
151 |
## First perform the retrieval based on the input message
|
|
|
128 |
" (Answer only from retrieval. Only cite sources that are used. Make your response conversational.)"
|
129 |
), ('user', '{input}')])
|
130 |
|
|
|
131 |
|
132 |
def RPrint(preface=""):
|
133 |
"""Simple passthrough "prints, then returns" chain"""
|
|
|
145 |
| RPrint()
|
146 |
)
|
147 |
|
148 |
+
stream_chain = chat_prompt| RPrint() | instruct_llm | StrOutputParser()
|
149 |
+
|
150 |
def chat_gen(message, history=[], return_buffer=True):
|
151 |
buffer = ""
|
152 |
## First perform the retrieval based on the input message
|