Spaces:
Running
on
Zero
Running
on
Zero
new code
Browse files- src/interface.py +47 -8
src/interface.py
CHANGED
@@ -18,14 +18,53 @@ def create_demo():
|
|
18 |
chat_history = gr.Chatbot(value=[], elem_id='chatbot', height=480)
|
19 |
show_img = gr.Image(label='Overview', height=480)
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
with gr.Row():
|
31 |
with gr.Column(scale=0.60):
|
|
|
18 |
chat_history = gr.Chatbot(value=[], elem_id='chatbot', height=480)
|
19 |
show_img = gr.Image(label='Overview', height=480)
|
20 |
|
21 |
+
# Sliders in the Rightmost Column
|
22 |
+
with gr.Column():
|
23 |
+
with gr.Row():
|
24 |
+
slider_chunk_size = gr.Slider(
|
25 |
+
minimum=256, maximum=1024, value=256, label="Chunk Size", elem_id='slider1'
|
26 |
+
)
|
27 |
+
gr.Markdown(
|
28 |
+
"""
|
29 |
+
**Chunk Size:** Controls the size of text chunks processed by the model. Larger chunks
|
30 |
+
provide more context but may increase processing time.
|
31 |
+
"""
|
32 |
+
)
|
33 |
+
|
34 |
+
with gr.Row():
|
35 |
+
slider_overlap_percentage = gr.Slider(
|
36 |
+
minimum=0, maximum=100, value=50, label="Chunk Overlap Percentage", elem_id='slider2'
|
37 |
+
)
|
38 |
+
gr.Markdown(
|
39 |
+
"""
|
40 |
+
**Chunk Overlap Percentage:** Determines the percentage of overlap between consecutive
|
41 |
+
chunks. Higher overlap can improve coherence but may also increase redundancy.
|
42 |
+
"""
|
43 |
+
)
|
44 |
+
|
45 |
+
with gr.Row():
|
46 |
+
slider_temp = gr.Slider(
|
47 |
+
minimum=0, maximum=1, value=0.5, label="Model Temperature", elem_id='slider3'
|
48 |
+
)
|
49 |
+
gr.Markdown(
|
50 |
+
"""
|
51 |
+
**Model Temperature:** Controls the randomness of the generated text. Higher temperature
|
52 |
+
leads to more creative and unpredictable outputs, while lower temperature results
|
53 |
+
in more conservative and deterministic text.
|
54 |
+
"""
|
55 |
+
)
|
56 |
+
|
57 |
+
with gr.Row():
|
58 |
+
slider_k = gr.Slider(
|
59 |
+
minimum=1, maximum=5, value=2, label="Max Chunks in Context", elem_id='slider2'
|
60 |
+
)
|
61 |
+
gr.Markdown(
|
62 |
+
"""
|
63 |
+
**Max Chunks in Context:** Determines the number of previous chunks considered by the
|
64 |
+
model when generating text. More chunks provide more context but may also increase
|
65 |
+
processing time.
|
66 |
+
"""
|
67 |
+
)
|
68 |
|
69 |
with gr.Row():
|
70 |
with gr.Column(scale=0.60):
|