Spaces:
Runtime error
Runtime error
Boardpac/theekshanas
commited on
Commit
•
69b7289
1
Parent(s):
7f9f814
solved issue update button click twise to update
Browse files
__pycache__/config.cpython-311.pyc
CHANGED
Binary files a/__pycache__/config.cpython-311.pyc and b/__pycache__/config.cpython-311.pyc differ
|
|
__pycache__/faissDb.cpython-311.pyc
CHANGED
Binary files a/__pycache__/faissDb.cpython-311.pyc and b/__pycache__/faissDb.cpython-311.pyc differ
|
|
__pycache__/qaPipeline.cpython-311.pyc
CHANGED
Binary files a/__pycache__/qaPipeline.cpython-311.pyc and b/__pycache__/qaPipeline.cpython-311.pyc differ
|
|
app.py
CHANGED
@@ -91,15 +91,12 @@ def main():
|
|
91 |
on_change=update_parameters_change,
|
92 |
)
|
93 |
|
|
|
94 |
if st.session_state.is_parameters_changed:
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
st.success("done")
|
100 |
-
st.session_state.is_parameters_changed = False
|
101 |
-
return
|
102 |
-
|
103 |
st.markdown("\n")
|
104 |
|
105 |
# if st.button("Create FAISS db"):
|
@@ -126,13 +123,19 @@ def main():
|
|
126 |
def update_parameters_change():
|
127 |
st.session_state.is_parameters_changed = True
|
128 |
|
129 |
-
def
|
|
|
|
|
|
|
|
|
|
|
130 |
|
|
|
|
|
131 |
response = qaPipeline.run(query=query, model=model, dataset=dataset)
|
132 |
return response
|
133 |
|
134 |
def show_query_response(query, response, show_source_files):
|
135 |
-
|
136 |
answer, docs = response['result'], response['source_documents']
|
137 |
|
138 |
st.write(user_template.replace(
|
|
|
91 |
on_change=update_parameters_change,
|
92 |
)
|
93 |
|
94 |
+
|
95 |
if st.session_state.is_parameters_changed:
|
96 |
+
st.button("Update", on_click=parameters_change_button, args=[chat_model, show_source])
|
97 |
+
|
98 |
+
|
99 |
+
|
|
|
|
|
|
|
|
|
100 |
st.markdown("\n")
|
101 |
|
102 |
# if st.button("Create FAISS db"):
|
|
|
123 |
def update_parameters_change():
|
124 |
st.session_state.is_parameters_changed = True
|
125 |
|
126 |
+
def parameters_change_button(chat_model, show_source):
|
127 |
+
st.session_state.model = chat_model
|
128 |
+
st.session_state.dataset = "DEFAULT"
|
129 |
+
st.session_state.show_source_files = show_source
|
130 |
+
st.success("chat parameters updated")
|
131 |
+
st.session_state.is_parameters_changed = False
|
132 |
|
133 |
+
|
134 |
+
def get_answer_from_backend(query, model, dataset):
|
135 |
response = qaPipeline.run(query=query, model=model, dataset=dataset)
|
136 |
return response
|
137 |
|
138 |
def show_query_response(query, response, show_source_files):
|
|
|
139 |
answer, docs = response['result'], response['source_documents']
|
140 |
|
141 |
st.write(user_template.replace(
|
ui/__pycache__/htmlTemplates.cpython-311.pyc
CHANGED
Binary files a/ui/__pycache__/htmlTemplates.cpython-311.pyc and b/ui/__pycache__/htmlTemplates.cpython-311.pyc differ
|
|