Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -162,9 +162,11 @@ css = """
|
|
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,
|
166 |
-
|
167 |
-
|
|
|
|
|
168 |
|
169 |
# Initial example questions from the initialization
|
170 |
formatted_questions = [q.strip() for q in follow_up_questions.split('\n')[:3]]
|
@@ -216,7 +218,7 @@ with gr.Blocks(css=css) as demo:
|
|
216 |
)
|
217 |
examples_component.select(
|
218 |
fn=fill_textbox,
|
219 |
-
inputs=[examples_state, gr.
|
220 |
outputs=[txt]
|
221 |
)
|
222 |
|
|
|
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, selected_row, txt):
|
166 |
+
if selected_row is not None and not examples_df.empty:
|
167 |
+
example_question = examples_df.iloc[selected_row]['Example Questions']
|
168 |
+
return example_question
|
169 |
+
return ""
|
170 |
|
171 |
# Initial example questions from the initialization
|
172 |
formatted_questions = [q.strip() for q in follow_up_questions.split('\n')[:3]]
|
|
|
218 |
)
|
219 |
examples_component.select(
|
220 |
fn=fill_textbox,
|
221 |
+
inputs=[examples_state, gr.Number(), txt],
|
222 |
outputs=[txt]
|
223 |
)
|
224 |
|