ginipick commited on
Commit
1edcd51
·
verified ·
1 Parent(s): ec487bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -6
app.py CHANGED
@@ -126,12 +126,15 @@ def take_screenshot(url):
126
  finally:
127
  if wd:
128
  wd.quit()
129
-
 
130
  def create_ui():
131
- spaces_list = get_most_liked_spaces()
132
- print(f"Type of spaces_list: {type(spaces_list)}")
133
- formatted_spaces = format_spaces(spaces_list)
134
- print(f"Total spaces loaded: {len(formatted_spaces)}")
 
 
135
 
136
  css = """
137
  footer {visibility: hidden;}
@@ -164,4 +167,18 @@ def create_ui():
164
  outputs=[info_output, app_py_content, screenshot_output]
165
  )
166
 
167
- return demo
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  finally:
127
  if wd:
128
  wd.quit()
129
+
130
+
131
  def create_ui():
132
+ try:
133
+ spaces_list = get_most_liked_spaces()
134
+ print(f"Type of spaces_list: {type(spaces_list)}")
135
+ formatted_spaces = format_spaces(spaces_list)
136
+ print(f"Total spaces loaded: {len(formatted_spaces)}")
137
+
138
 
139
  css = """
140
  footer {visibility: hidden;}
 
167
  outputs=[info_output, app_py_content, screenshot_output]
168
  )
169
 
170
+ return demo
171
+
172
+
173
+ except Exception as e:
174
+ print(f"Error in create_ui: {str(e)}")
175
+ print(traceback.format_exc())
176
+ raise
177
+
178
+ if __name__ == "__main__":
179
+ try:
180
+ demo = create_ui()
181
+ demo.launch()
182
+ except Exception as e:
183
+ print(f"Error in main: {str(e)}")
184
+ print(traceback.format_exc())