Update app.py
Browse files
app.py
CHANGED
|
@@ -70,7 +70,7 @@ def build_experimental_ui():
|
|
| 70 |
st.session_state['pdf_file'] = pdf_docs
|
| 71 |
with st.spinner('Creating embeddings...'):
|
| 72 |
texts = get_text_chunks(pdf_docs=pdf_docs)
|
| 73 |
-
st.write([len(x) for x in texts])
|
| 74 |
# retriever = get_retriever_from_text(texts, embeddings[selected_embeddings])
|
| 75 |
# st.session_state['retriever'] = retriever
|
| 76 |
|
|
@@ -94,28 +94,26 @@ def build_experimental_ui():
|
|
| 94 |
|
| 95 |
if questions_file:
|
| 96 |
questions_df = pd.read_csv(questions_file)
|
| 97 |
-
|
| 98 |
-
return
|
| 99 |
-
|
| 100 |
-
chat_content = {}
|
| 101 |
-
chat_content['question'] = st.session_state.query
|
| 102 |
|
| 103 |
-
if strategy=='Without Chain-of-Thought':
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
|
| 109 |
-
if st.session_state.query is None:
|
| 110 |
-
|
| 111 |
-
else:
|
| 112 |
-
|
| 113 |
|
| 114 |
-
button_query = st.button('Submit', disabled=
|
| 115 |
|
| 116 |
|
| 117 |
if button_query:
|
| 118 |
|
|
|
|
|
|
|
|
|
|
| 119 |
print('---- run query ----')
|
| 120 |
print(f'model: {selected_model} embeddings: {selected_embeddings}')
|
| 121 |
if selected_embeddings!=st.session_state['selected_embeddings']:
|
|
|
|
| 70 |
st.session_state['pdf_file'] = pdf_docs
|
| 71 |
with st.spinner('Creating embeddings...'):
|
| 72 |
texts = get_text_chunks(pdf_docs=pdf_docs)
|
| 73 |
+
# st.write([len(x) for x in texts])
|
| 74 |
# retriever = get_retriever_from_text(texts, embeddings[selected_embeddings])
|
| 75 |
# st.session_state['retriever'] = retriever
|
| 76 |
|
|
|
|
| 94 |
|
| 95 |
if questions_file:
|
| 96 |
questions_df = pd.read_csv(questions_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+
# if strategy=='Without Chain-of-Thought':
|
| 99 |
+
# instruction = st.text_area('Input your instruction (optional)', value=st.session_state['qa_instruction'], disabled=disable_query)
|
| 100 |
+
# with st.expander("Sample instruction"):
|
| 101 |
+
# sample_instruction = "Answer the question based on the context provided. Explain with reason in bullet points. Let's think step by step."
|
| 102 |
+
# button_sample_instruction = st.button(sample_instruction, key='instruction1', disabled=disable_query, on_click=set_qa_instruction, args=(sample_instruction,))
|
| 103 |
|
| 104 |
+
# if st.session_state.query is None:
|
| 105 |
+
# disable = True
|
| 106 |
+
# else:
|
| 107 |
+
# disable = False
|
| 108 |
|
| 109 |
+
button_query = st.button('Submit', disabled=False)
|
| 110 |
|
| 111 |
|
| 112 |
if button_query:
|
| 113 |
|
| 114 |
+
for question in questions_df['question']:
|
| 115 |
+
instruction = f'{prompt}.Question:{question}'
|
| 116 |
+
|
| 117 |
print('---- run query ----')
|
| 118 |
print(f'model: {selected_model} embeddings: {selected_embeddings}')
|
| 119 |
if selected_embeddings!=st.session_state['selected_embeddings']:
|