Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -42,8 +42,7 @@ def add_text(history, text):
|
|
42 |
return history, gr.Textbox(value="", interactive=False)
|
43 |
|
44 |
def api_call(history, api_kind, table_name, openai_key, rerank):
|
45 |
-
for history, prompt_html in bot(history, api_kind, table_name, openai_key, rerank)
|
46 |
-
yield history
|
47 |
|
48 |
def bot(history, api_kind, table_name, openai_key, rerank):
|
49 |
top_k_rank = 4
|
@@ -142,8 +141,10 @@ with gr.Blocks() as demo:
|
|
142 |
# Examples
|
143 |
gr.Examples(examples, txt)
|
144 |
|
|
|
145 |
hidden = gr.Button(value="Ignore", visible=False)
|
146 |
-
hidden.click(api_call, [chatbot, api_kind, table_name, openai_key, rerank], [
|
|
|
147 |
|
148 |
demo.queue()
|
149 |
demo.launch(debug=True)
|
|
|
42 |
return history, gr.Textbox(value="", interactive=False)
|
43 |
|
44 |
def api_call(history, api_kind, table_name, openai_key, rerank):
|
45 |
+
return ' '.join([history for history, prompt_html in bot(history, api_kind, table_name, openai_key, rerank)])
|
|
|
46 |
|
47 |
def bot(history, api_kind, table_name, openai_key, rerank):
|
48 |
top_k_rank = 4
|
|
|
141 |
# Examples
|
142 |
gr.Examples(examples, txt)
|
143 |
|
144 |
+
hidden_txt = gr.Textbox(visible=False)
|
145 |
hidden = gr.Button(value="Ignore", visible=False)
|
146 |
+
hidden.click(api_call, [chatbot, api_kind, table_name, openai_key, rerank], [hidden_txt])
|
147 |
+
|
148 |
|
149 |
demo.queue()
|
150 |
demo.launch(debug=True)
|