Spaces:
Sleeping
Sleeping
Jesus Sanchez commited on
Commit ·
25e33cc
1
Parent(s): 82afe3d
revert to chat input
Browse files
app.py
CHANGED
|
@@ -164,8 +164,6 @@ What trades did client {client} do in May 2022
|
|
| 164 |
with st.sidebar:
|
| 165 |
st.markdown(sidebar_text)
|
| 166 |
|
| 167 |
-
[tab] = st.tabs(["AskIDF"])
|
| 168 |
prompt = chat.get_promt("Ask IDF Anything")
|
| 169 |
|
| 170 |
-
|
| 171 |
-
chat.process(prompt, get_response, llm)
|
|
|
|
| 164 |
with st.sidebar:
|
| 165 |
st.markdown(sidebar_text)
|
| 166 |
|
|
|
|
| 167 |
prompt = chat.get_promt("Ask IDF Anything")
|
| 168 |
|
| 169 |
+
chat.process(prompt, get_response, llm)
|
|
|
chat.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from sqlalchemy import label
|
| 2 |
import streamlit as st
|
| 3 |
from typing import Callable
|
|
@@ -37,7 +38,7 @@ class Chat:
|
|
| 37 |
|
| 38 |
# Render history
|
| 39 |
messages = zip(st.session_state[PROMPT_LABEL], st.session_state[RESPONSE_LABEL])
|
| 40 |
-
for prompt, (response, on_render) in messages:
|
| 41 |
with st.chat_message("user"):
|
| 42 |
st.write(prompt)
|
| 43 |
with st.chat_message("assistant"):
|
|
|
|
| 1 |
+
from langchain.llms.base import get_prompts
|
| 2 |
from sqlalchemy import label
|
| 3 |
import streamlit as st
|
| 4 |
from typing import Callable
|
|
|
|
| 38 |
|
| 39 |
# Render history
|
| 40 |
messages = zip(st.session_state[PROMPT_LABEL], st.session_state[RESPONSE_LABEL])
|
| 41 |
+
for prompt, (response, on_render) in list(messages)[::-1]:
|
| 42 |
with st.chat_message("user"):
|
| 43 |
st.write(prompt)
|
| 44 |
with st.chat_message("assistant"):
|