Spaces:
Sleeping
Sleeping
remove api_kind
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def add_text(history, text):
|
|
35 |
return history, gr.Textbox(value="", interactive=False)
|
36 |
|
37 |
|
38 |
-
def bot(history,
|
39 |
top_k_param = int(top_k_param)
|
40 |
query = history[-1][0]
|
41 |
|
@@ -106,8 +106,8 @@ with gr.Blocks() as demo:
|
|
106 |
)
|
107 |
txt_btn = gr.Button(value="Submit text", scale=1)
|
108 |
|
109 |
-
api_kind = gr.Radio(choices=["HuggingFace",
|
110 |
-
|
111 |
|
112 |
chunk_table = gr.Radio(choices=["BGE_CharacterTextSplitter",
|
113 |
"BGE_FixedSizeSplitter",
|
@@ -171,14 +171,14 @@ with gr.Blocks() as demo:
|
|
171 |
prompt_html = gr.HTML()
|
172 |
# Turn off interactivity while generating if you click
|
173 |
txt_msg = txt_btn.click(add_text, [chatbot, txt], [chatbot, txt], queue=False).then(
|
174 |
-
bot, [chatbot,
|
175 |
|
176 |
# Turn it back on
|
177 |
txt_msg.then(lambda: gr.Textbox(interactive=True), None, [txt], queue=False)
|
178 |
|
179 |
# Turn off interactivity while generating if you hit enter
|
180 |
txt_msg = txt.submit(add_text, [chatbot, txt], [chatbot, txt], queue=False).then(
|
181 |
-
bot, [chatbot,
|
182 |
|
183 |
# Turn it back on
|
184 |
txt_msg.then(lambda: gr.Textbox(interactive=True), None, [txt], queue=False)
|
|
|
35 |
return history, gr.Textbox(value="", interactive=False)
|
36 |
|
37 |
|
38 |
+
def bot(history, chunk_table, embedding_model, llm_model, cross_encoder, top_k_param, rerank_topk ):
|
39 |
top_k_param = int(top_k_param)
|
40 |
query = history[-1][0]
|
41 |
|
|
|
106 |
)
|
107 |
txt_btn = gr.Button(value="Submit text", scale=1)
|
108 |
|
109 |
+
#api_kind = gr.Radio(choices=["HuggingFace",
|
110 |
+
# "OpenAI"], value="HuggingFace")
|
111 |
|
112 |
chunk_table = gr.Radio(choices=["BGE_CharacterTextSplitter",
|
113 |
"BGE_FixedSizeSplitter",
|
|
|
171 |
prompt_html = gr.HTML()
|
172 |
# Turn off interactivity while generating if you click
|
173 |
txt_msg = txt_btn.click(add_text, [chatbot, txt], [chatbot, txt], queue=False).then(
|
174 |
+
bot, [chatbot, chunk_table, embedding_model, llm_model, cross_encoder, top_k_param, rerank_topk], [chatbot, prompt_html])
|
175 |
|
176 |
# Turn it back on
|
177 |
txt_msg.then(lambda: gr.Textbox(interactive=True), None, [txt], queue=False)
|
178 |
|
179 |
# Turn off interactivity while generating if you hit enter
|
180 |
txt_msg = txt.submit(add_text, [chatbot, txt], [chatbot, txt], queue=False).then(
|
181 |
+
bot, [chatbot, chunk_table, embedding_model, llm_model, cross_encoder, top_k_param, rerank_topk], [chatbot, prompt_html])
|
182 |
|
183 |
# Turn it back on
|
184 |
txt_msg.then(lambda: gr.Textbox(interactive=True), None, [txt], queue=False)
|