Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -162,7 +162,9 @@ css = """
|
|
162 |
# Initialize the chat history and suggested questionsw
|
163 |
chat_history, follow_up_questions, initial_token_info = initialize_chat()
|
164 |
|
165 |
-
|
|
|
|
|
166 |
|
167 |
# Initial example questions from the initialization
|
168 |
formatted_questions = [q.strip() for q in follow_up_questions.split('\n')[:3]]
|
@@ -209,7 +211,13 @@ with gr.Blocks(css=css) as demo:
|
|
209 |
value=examples_state.value,
|
210 |
headers=['Example Questions'],
|
211 |
datatype='str',
|
212 |
-
elem_id="example-container"
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
)
|
214 |
|
215 |
chatbot.like(print_like_dislike, None, None)
|
|
|
162 |
# Initialize the chat history and suggested questionsw
|
163 |
chat_history, follow_up_questions, initial_token_info = initialize_chat()
|
164 |
|
165 |
+
def fill_textbox(examples_df, row_index, txt):
|
166 |
+
example_question = examples_df.iloc[row_index]['Example Questions']
|
167 |
+
return example_question
|
168 |
|
169 |
# Initial example questions from the initialization
|
170 |
formatted_questions = [q.strip() for q in follow_up_questions.split('\n')[:3]]
|
|
|
211 |
value=examples_state.value,
|
212 |
headers=['Example Questions'],
|
213 |
datatype='str',
|
214 |
+
elem_id="example-container",
|
215 |
+
interactive=True
|
216 |
+
)
|
217 |
+
examples_component.select(
|
218 |
+
fn=fill_textbox,
|
219 |
+
inputs=[examples_state, gr.Index(), txt],
|
220 |
+
outputs=[txt]
|
221 |
)
|
222 |
|
223 |
chatbot.like(print_like_dislike, None, None)
|