Skip to content

Commit def57dd

Browse files
committed
some ui fixes due to package updates
1 parent 1022442 commit def57dd

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

datadm/app.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def setup_repl():
7777
#fullheight {height: 87vh; flex-wrap: nowrap;}
7878
#chatbox > .wrap { max-height: none !important; }
7979
#chatbox img { max-height: none !important; max-width: 100% !important; }
80-
#justify_center {justify-content: center !important; min-width: min(180px, 100%) !important;}
80+
#justify_center {justify-content: center !important;}
81+
#load_model_button {flex-grow: 0 !important;}
82+
#upload_button {flex-grow: 0 !important;}
8183
"""
8284

8385
class DataSearchResultRowComponent:
@@ -91,7 +93,7 @@ def __init__(self):
9193
self.gradios = {
9294
'html': {'class': gr.HTML, 'kwargs': {'value': '<div></div>'}},
9395
'url': {'class': gr.Text, 'kwargs': {'value': 'unknown', "visible": False}},
94-
'download': {'class': gr.Button, 'kwargs': {'value': 'Add To Chat'}},
96+
'download': {'class': gr.Button, 'kwargs': {'value': 'Add To Chat', "container": False}},
9597
}
9698
self.ref_order = []
9799

@@ -105,8 +107,8 @@ def gradio_gen(self, upload_magic_thens):
105107
with gr.Column(scale=10):
106108
objs.append(self.component('html'))
107109
objs.append(self.component('url'))
108-
with gr.Column(scale=1, elem_id="justify_center"):
109-
objs.append(self.component('download').style(container=False))
110+
with gr.Column(scale=1, elem_id="justify_center", min_width=180):
111+
objs.append(self.component('download'))
110112
events = objs[-1].click(lambda url: print(f"Downloading CSV: {url}"), objs[-2], None)
111113
for then_args in upload_magic_thens(objs[-2]):
112114
events.then(*then_args)
@@ -245,12 +247,13 @@ def randomupdate(query, container):
245247
label="Chat Message Box",
246248
placeholder="Chat Message Box",
247249
show_label=False,
248-
elem_id="chat_message_box"
249-
).style(container=False)
250+
elem_id="chat_message_box",
251+
container=False
252+
)
250253
with gr.Column():
251254
with gr.Row():
252255
submit = gr.Button("Submit", elem_id="submit_button")
253-
cancel = gr.Button("Cancel", visible=False)
256+
cancel = gr.Button("Cancel", variant="stop", visible=False)
254257
undo = gr.Button("Undo")
255258
retry = gr.Button("Retry")
256259
with gr.Column(scale=1):
@@ -261,7 +264,8 @@ def randomupdate(query, container):
261264
label="agent",
262265
multiselect=False,
263266
show_label=True,
264-
interactive=True).style(container=False)
267+
interactive=True,
268+
container=False)
265269
with gr.Row():
266270
model_selection = gr.Dropdown(
267271
choices=list(llm_manager.llms.keys()),
@@ -270,8 +274,9 @@ def randomupdate(query, container):
270274
multiselect=False,
271275
show_label=True,
272276
interactive=True,
273-
elem_id='model_selection_dropdown').style(container=False)
274-
model_state = gr.HighlightedText(label=False).style(container=False)
277+
elem_id='model_selection_dropdown',
278+
container=False)
279+
model_state = gr.HighlightedText(label=False, container=False)
275280
load_model = gr.Button("Load Model", visible=False, elem_id="load_model_button")
276281
files.append(gr.Text("No Data Files", label="Data Files"))
277282
for _ in range(10):
@@ -292,8 +297,9 @@ def randomupdate(query, container):
292297
label="Search",
293298
placeholder="What data are you looking for?",
294299
show_label=False,
295-
elem_id="search_textbox"
296-
).style(container=False)
300+
elem_id="search_textbox",
301+
container=False
302+
)
297303
search = gr.Button("Search")
298304
with gr.Column():
299305
results.extend(container.value.gradio_gen(upload_magic_thens))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ classifiers = [
1414
]
1515
dependencies = [
1616
"gradio",
17-
"guidance",
17+
"guidance==0.0.61",
1818
"jupyter",
1919
"matplotlib",
2020
"pandas",

0 commit comments

Comments
 (0)