Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -118,7 +118,7 @@ with gr.Blocks(theme=gr.themes.Soft(text_size='lg', font=["monospace"], primary_
|
|
118 |
value=LABEL_TEXTSPLITTER,
|
119 |
label="Method to split chunks π",
|
120 |
)
|
121 |
-
|
122 |
elem_id="textbox_id",
|
123 |
value=["### ", "\n\n", "\n", ".", " "],
|
124 |
info="Separators used in RecursiveCharacterTextSplitter",
|
@@ -155,11 +155,11 @@ with gr.Blocks(theme=gr.themes.Soft(text_size='lg', font=["monospace"], primary_
|
|
155 |
|
156 |
split_selection.change(
|
157 |
fn=change_split_selection,
|
158 |
-
inputs=[text, slider_count, split_selection,
|
159 |
-
outputs=[
|
160 |
)
|
161 |
gr.on(
|
162 |
-
[text.change, length_unit_selection.change,
|
163 |
chunk,
|
164 |
[text, slider_count, split_selection, separators_selection, length_unit_selection, chunk_overlap],
|
165 |
outputs=out
|
|
|
118 |
value=LABEL_TEXTSPLITTER,
|
119 |
label="Method to split chunks π",
|
120 |
)
|
121 |
+
separators_selection = gr.Textbox(
|
122 |
elem_id="textbox_id",
|
123 |
value=["### ", "\n\n", "\n", ".", " "],
|
124 |
info="Separators used in RecursiveCharacterTextSplitter",
|
|
|
155 |
|
156 |
split_selection.change(
|
157 |
fn=change_split_selection,
|
158 |
+
inputs=[text, slider_count, split_selection, separators_selection, length_unit_selection, chunk_overlap],
|
159 |
+
outputs=[separators_selection, out],
|
160 |
)
|
161 |
gr.on(
|
162 |
+
[text.change, length_unit_selection.change, separators_selection.change, slider_count.change, chunk_overlap.change],
|
163 |
chunk,
|
164 |
[text, slider_count, split_selection, separators_selection, length_unit_selection, chunk_overlap],
|
165 |
outputs=out
|