Spaces:
Running
Running
add chunk_table value
Browse files
app.py
CHANGED
|
@@ -87,18 +87,25 @@ with gr.Blocks() as demo:
|
|
| 87 |
txt_btn = gr.Button(value="Submit text", scale=1)
|
| 88 |
|
| 89 |
api_kind = gr.Radio(choices=["HuggingFace", "OpenAI"], value="HuggingFace")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
prompt_html = gr.HTML()
|
| 92 |
# Turn off interactivity while generating if you click
|
| 93 |
txt_msg = txt_btn.click(add_text, [chatbot, txt], [chatbot, txt], queue=False).then(
|
| 94 |
-
bot, [chatbot, api_kind], [chatbot, prompt_html])
|
| 95 |
|
| 96 |
# Turn it back on
|
| 97 |
txt_msg.then(lambda: gr.Textbox(interactive=True), None, [txt], queue=False)
|
| 98 |
|
| 99 |
# Turn off interactivity while generating if you hit enter
|
| 100 |
txt_msg = txt.submit(add_text, [chatbot, txt], [chatbot, txt], queue=False).then(
|
| 101 |
-
bot, [chatbot, api_kind], [chatbot, prompt_html])
|
| 102 |
|
| 103 |
# Turn it back on
|
| 104 |
txt_msg.then(lambda: gr.Textbox(interactive=True), None, [txt], queue=False)
|
|
|
|
| 87 |
txt_btn = gr.Button(value="Submit text", scale=1)
|
| 88 |
|
| 89 |
api_kind = gr.Radio(choices=["HuggingFace", "OpenAI"], value="HuggingFace")
|
| 90 |
+
chunk_table = gr.Radio(choices=["BGE_CharacterTextSplitter", "BGE_FixedSizeSplitter",
|
| 91 |
+
"BGE_RecursiveCharacterTextSplitter", "MiniLM_CharacterTextSplitter",
|
| 92 |
+
"MiniLM_CharacterTextSplitter", "MiniLM_FixedSizeSplitter",
|
| 93 |
+
"MiniLM_RecursiveCharacterSplitter"],
|
| 94 |
+
value="MiniLM_CharacterTextSplitter",
|
| 95 |
+
label="Chunk table")
|
| 96 |
+
|
| 97 |
|
| 98 |
prompt_html = gr.HTML()
|
| 99 |
# Turn off interactivity while generating if you click
|
| 100 |
txt_msg = txt_btn.click(add_text, [chatbot, txt], [chatbot, txt], queue=False).then(
|
| 101 |
+
bot, [chatbot, api_kind, chunk_table], [chatbot, prompt_html])
|
| 102 |
|
| 103 |
# Turn it back on
|
| 104 |
txt_msg.then(lambda: gr.Textbox(interactive=True), None, [txt], queue=False)
|
| 105 |
|
| 106 |
# Turn off interactivity while generating if you hit enter
|
| 107 |
txt_msg = txt.submit(add_text, [chatbot, txt], [chatbot, txt], queue=False).then(
|
| 108 |
+
bot, [chatbot, api_kind, chunk_table], [chatbot, prompt_html])
|
| 109 |
|
| 110 |
# Turn it back on
|
| 111 |
txt_msg.then(lambda: gr.Textbox(interactive=True), None, [txt], queue=False)
|