@@ -77,7 +77,9 @@ def setup_repl():
77
77
#fullheight {height: 87vh; flex-wrap: nowrap;}
78
78
#chatbox > .wrap { max-height: none !important; }
79
79
#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;}
81
83
"""
82
84
83
85
class DataSearchResultRowComponent :
@@ -91,7 +93,7 @@ def __init__(self):
91
93
self .gradios = {
92
94
'html' : {'class' : gr .HTML , 'kwargs' : {'value' : '<div></div>' }},
93
95
'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 }},
95
97
}
96
98
self .ref_order = []
97
99
@@ -105,8 +107,8 @@ def gradio_gen(self, upload_magic_thens):
105
107
with gr .Column (scale = 10 ):
106
108
objs .append (self .component ('html' ))
107
109
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' ))
110
112
events = objs [- 1 ].click (lambda url : print (f"Downloading CSV: { url } " ), objs [- 2 ], None )
111
113
for then_args in upload_magic_thens (objs [- 2 ]):
112
114
events .then (* then_args )
@@ -245,12 +247,13 @@ def randomupdate(query, container):
245
247
label = "Chat Message Box" ,
246
248
placeholder = "Chat Message Box" ,
247
249
show_label = False ,
248
- elem_id = "chat_message_box"
249
- ).style (container = False )
250
+ elem_id = "chat_message_box" ,
251
+ container = False
252
+ )
250
253
with gr .Column ():
251
254
with gr .Row ():
252
255
submit = gr .Button ("Submit" , elem_id = "submit_button" )
253
- cancel = gr .Button ("Cancel" , visible = False )
256
+ cancel = gr .Button ("Cancel" , variant = "stop" , visible = False )
254
257
undo = gr .Button ("Undo" )
255
258
retry = gr .Button ("Retry" )
256
259
with gr .Column (scale = 1 ):
@@ -261,7 +264,8 @@ def randomupdate(query, container):
261
264
label = "agent" ,
262
265
multiselect = False ,
263
266
show_label = True ,
264
- interactive = True ).style (container = False )
267
+ interactive = True ,
268
+ container = False )
265
269
with gr .Row ():
266
270
model_selection = gr .Dropdown (
267
271
choices = list (llm_manager .llms .keys ()),
@@ -270,8 +274,9 @@ def randomupdate(query, container):
270
274
multiselect = False ,
271
275
show_label = True ,
272
276
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 )
275
280
load_model = gr .Button ("Load Model" , visible = False , elem_id = "load_model_button" )
276
281
files .append (gr .Text ("No Data Files" , label = "Data Files" ))
277
282
for _ in range (10 ):
@@ -292,8 +297,9 @@ def randomupdate(query, container):
292
297
label = "Search" ,
293
298
placeholder = "What data are you looking for?" ,
294
299
show_label = False ,
295
- elem_id = "search_textbox"
296
- ).style (container = False )
300
+ elem_id = "search_textbox" ,
301
+ container = False
302
+ )
297
303
search = gr .Button ("Search" )
298
304
with gr .Column ():
299
305
results .extend (container .value .gradio_gen (upload_magic_thens ))
0 commit comments