limitedonly41 commited on
Commit
55f04f3
·
verified ·
1 Parent(s): cf30d53

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -4
app.py CHANGED
@@ -188,12 +188,27 @@ with gr.Blocks(title="Категоризатор сайтов", theme=gr.themes.
188
  url_display, category, info = app.get_current_info()
189
 
190
  # dynamically merge categories from data
191
- all_categories = list(set(app.categories + [c for c in (row["category"] for row in app.results_data) if c]))
192
-
 
 
193
  iframe_html = f'<iframe src="{iframe_url}" width="100%" height="900px" style="border-radius:8px;"></iframe>'
194
- return status, iframe_html, url_display, gr.Dropdown.update(choices=all_categories, value=category), info
 
 
 
 
 
 
 
195
  else:
196
- return status, website_viewer.value, "", gr.Dropdown.update(choices=app.categories, value=None), ""
 
 
 
 
 
 
197
 
198
 
199
  def handle_navigation(direction):
 
188
  url_display, category, info = app.get_current_info()
189
 
190
  # dynamically merge categories from data
191
+ all_categories = list(set(app.categories + [
192
+ c for c in (row["category"] for row in app.results_data) if c
193
+ ]))
194
+
195
  iframe_html = f'<iframe src="{iframe_url}" width="100%" height="900px" style="border-radius:8px;"></iframe>'
196
+
197
+ return (
198
+ status,
199
+ iframe_html,
200
+ url_display,
201
+ gr.update(choices=all_categories, value=category),
202
+ info
203
+ )
204
  else:
205
+ return (
206
+ status,
207
+ website_viewer.value,
208
+ "",
209
+ gr.update(choices=app.categories, value=None),
210
+ ""
211
+ )
212
 
213
 
214
  def handle_navigation(direction):