Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,7 +87,7 @@ def prepare_conversation(vectorstore):
|
|
| 87 |
# llm = ChatOpenAI()
|
| 88 |
# llm = HuggingFaceHub(repo_id="google/flan-t5-xxl", model_kwargs={"temperature":0.5, "max_length":512})
|
| 89 |
# google/bigbird-roberta-base facebook/bart-large
|
| 90 |
-
llm = HuggingFaceHub(repo_id="google/flan-t5-xxl", model_kwargs={"temperature": 0.
|
| 91 |
|
| 92 |
memory = ConversationBufferMemory(
|
| 93 |
memory_key='chat_history', return_messages=True)
|
|
@@ -132,6 +132,8 @@ def process_user_question(user_question):
|
|
| 132 |
|
| 133 |
for i, message in enumerate(st.session_state.chat_history):
|
| 134 |
|
|
|
|
|
|
|
| 135 |
print('results_size on msg: ', results_size, i, ( results_size - 6 ) )
|
| 136 |
if results_size > 6:
|
| 137 |
if i < ( results_size - 6 ):
|
|
@@ -196,7 +198,7 @@ def main():
|
|
| 196 |
st.header("Pennwick File Analyzer 2")
|
| 197 |
|
| 198 |
user_question = None
|
| 199 |
-
user_question = st.text_input("Ask the Model a question about your uploaded documents:")
|
| 200 |
if user_question != None:
|
| 201 |
print( 'calling process question', user_question)
|
| 202 |
process_user_question(user_question)
|
|
@@ -208,12 +210,14 @@ def main():
|
|
| 208 |
|
| 209 |
with st.sidebar:
|
| 210 |
|
| 211 |
-
st.subheader("
|
|
|
|
|
|
|
| 212 |
pdf_docs = st.file_uploader(
|
| 213 |
-
"Upload your
|
| 214 |
|
| 215 |
# Upon button press
|
| 216 |
-
if st.button("
|
| 217 |
with st.spinner("Processing..."):
|
| 218 |
|
| 219 |
#################################################################
|
|
|
|
| 87 |
# llm = ChatOpenAI()
|
| 88 |
# llm = HuggingFaceHub(repo_id="google/flan-t5-xxl", model_kwargs={"temperature":0.5, "max_length":512})
|
| 89 |
# google/bigbird-roberta-base facebook/bart-large
|
| 90 |
+
llm = HuggingFaceHub(repo_id="google/flan-t5-xxl", model_kwargs={"temperature": 0.7, "max_length": 512})
|
| 91 |
|
| 92 |
memory = ConversationBufferMemory(
|
| 93 |
memory_key='chat_history', return_messages=True)
|
|
|
|
| 132 |
|
| 133 |
for i, message in enumerate(st.session_state.chat_history):
|
| 134 |
|
| 135 |
+
# Scrolling looses the last printed line, only print the last 6 lines
|
| 136 |
+
#
|
| 137 |
print('results_size on msg: ', results_size, i, ( results_size - 6 ) )
|
| 138 |
if results_size > 6:
|
| 139 |
if i < ( results_size - 6 ):
|
|
|
|
| 198 |
st.header("Pennwick File Analyzer 2")
|
| 199 |
|
| 200 |
user_question = None
|
| 201 |
+
user_question = st.text_input("Ask the Open Source - Flan-t5 Model a question about your uploaded documents:")
|
| 202 |
if user_question != None:
|
| 203 |
print( 'calling process question', user_question)
|
| 204 |
process_user_question(user_question)
|
|
|
|
| 210 |
|
| 211 |
with st.sidebar:
|
| 212 |
|
| 213 |
+
st.subheader("Which documents would you like to analyze?")
|
| 214 |
+
st.subheader("(no data is saved beyond the session)")
|
| 215 |
+
|
| 216 |
pdf_docs = st.file_uploader(
|
| 217 |
+
"Upload your PDF documents here and click on 'Analyze'", accept_multiple_files=True)
|
| 218 |
|
| 219 |
# Upon button press
|
| 220 |
+
if st.button("Analyze these files"):
|
| 221 |
with st.spinner("Processing..."):
|
| 222 |
|
| 223 |
#################################################################
|