- app.py +28 -26
- statics/styles.css +21 -2
app.py
CHANGED
@@ -138,39 +138,41 @@ def main(args):
|
|
138 |
"summary_diff_history": []
|
139 |
})
|
140 |
|
141 |
-
gr.
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
)
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
elem_classes=["summary-window"],
|
159 |
-
visible=False
|
160 |
-
)
|
161 |
-
|
162 |
-
summary_md = gr.Markdown(
|
163 |
-
label="Summary so far",
|
164 |
-
elem_classes=["summary-window"],
|
165 |
-
visible=True
|
166 |
-
)
|
167 |
|
168 |
-
|
169 |
|
170 |
view_toggle_btn.change(change_view_toggle, inputs=[view_toggle_btn], outputs=[summary_diff, summary_md])
|
171 |
summary_num.release(navigate_to_summary, inputs=[summary_num, state], outputs=[summary_diff, summary_md])
|
172 |
|
173 |
-
with gr.Column("chat-window"):
|
174 |
gr.ChatInterface(
|
175 |
multimodal=True,
|
176 |
type="messages",
|
|
|
138 |
"summary_diff_history": []
|
139 |
})
|
140 |
|
141 |
+
with gr.Column():
|
142 |
+
gr.Markdown("# Adaptive Summarization")
|
143 |
+
gr.Markdown("AdaptSum stands for Adaptive Summarization. This project focuses on developing an LLM-powered system for dynamic summarization. Instead of generating entirely new summaries with each update, the system intelligently identifies and modifies only the necessary parts of the existing summary. This approach aims to create a more efficient and fluid summarization process within a continuous chat interaction with an LLM.")
|
144 |
+
|
145 |
+
with gr.Column():
|
146 |
+
with gr.Accordion("Adaptively Summarized Conversation", elem_id="adaptive-summary-accordion", open=False):
|
147 |
+
with gr.Row(elem_id="view-toggle-btn-container"):
|
148 |
+
view_toggle_btn = gr.Radio(
|
149 |
+
choices=["Diff", "Markdown"],
|
150 |
+
value="Markdown",
|
151 |
+
interactive=True,
|
152 |
+
elem_id="view-toggle-btn"
|
153 |
+
)
|
154 |
+
|
155 |
+
summary_diff = gr.HighlightedText(
|
156 |
+
label="Summary so far",
|
157 |
+
combine_adjacent=True,
|
158 |
+
show_legend=True,
|
159 |
+
color_map={"+": "red", "-": "green"},
|
160 |
+
elem_classes=["summary-window"],
|
161 |
+
visible=False
|
162 |
)
|
163 |
|
164 |
+
summary_md = gr.Markdown(
|
165 |
+
label="Summary so far",
|
166 |
+
elem_classes=["summary-window"],
|
167 |
+
visible=True
|
168 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
+
summary_num = gr.Slider(label="summary history", minimum=1, maximum=1, step=1, show_reset_button=False, visible=False)
|
171 |
|
172 |
view_toggle_btn.change(change_view_toggle, inputs=[view_toggle_btn], outputs=[summary_diff, summary_md])
|
173 |
summary_num.release(navigate_to_summary, inputs=[summary_num, state], outputs=[summary_diff, summary_md])
|
174 |
|
175 |
+
with gr.Column("chat-window", elem_id="chat-window"):
|
176 |
gr.ChatInterface(
|
177 |
multimodal=True,
|
178 |
type="messages",
|
statics/styles.css
CHANGED
@@ -1,9 +1,14 @@
|
|
1 |
.summary-window {
|
2 |
-
height:
|
3 |
-
border:
|
|
|
4 |
padding: 4px;
|
5 |
}
|
6 |
|
|
|
|
|
|
|
|
|
7 |
#view-toggle-btn-container > div {
|
8 |
border: none !important;
|
9 |
}
|
@@ -17,6 +22,20 @@
|
|
17 |
width: fit-content !important;
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
.textfield {
|
21 |
line-height: 1.7 !important;
|
22 |
}
|
|
|
1 |
.summary-window {
|
2 |
+
height: 550px !important;
|
3 |
+
border: dashed 1px #e0e0e0 !important;
|
4 |
+
border-radius: 10px !important;
|
5 |
padding: 4px;
|
6 |
}
|
7 |
|
8 |
+
.summary-window > label {
|
9 |
+
display: none !important;
|
10 |
+
}
|
11 |
+
|
12 |
#view-toggle-btn-container > div {
|
13 |
border: none !important;
|
14 |
}
|
|
|
22 |
width: fit-content !important;
|
23 |
}
|
24 |
|
25 |
+
#adaptive-summary-accordion {
|
26 |
+
position: absolute !important;
|
27 |
+
z-index: 100 !important;
|
28 |
+
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
|
29 |
+
}
|
30 |
+
|
31 |
+
#chat-window {
|
32 |
+
margin-top: 40px !important;
|
33 |
+
}
|
34 |
+
|
35 |
+
#chat-window > div > div:nth-child(1) {
|
36 |
+
height: 600px !important;
|
37 |
+
}
|
38 |
+
|
39 |
.textfield {
|
40 |
line-height: 1.7 !important;
|
41 |
}
|