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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -32
app.py CHANGED
@@ -134,41 +134,39 @@ def create_ui():
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;}
141
- .minimal-button {min-width: 30px !important; height: 25px !important; line-height: 1 !important; font-size: 12px !important; padding: 2px 5px !important;}
142
- .space-row {margin-bottom: 5px !important;}
143
- """
144
 
145
- with gr.Blocks(css=css, theme="Nymbo/Nymbo_Theme") as demo:
146
- gr.Markdown("# Hugging Face Most Liked Spaces")
147
-
148
- with gr.Row():
149
- with gr.Column(scale=1):
150
- space_rows = []
151
- for space in formatted_spaces:
152
- with gr.Row(elem_classes="space-row") as space_row:
153
- with gr.Column():
154
- gr.Markdown(f"{space['name']} by {space['author']} (Likes: {space['likes']})", elem_classes="space-info")
155
- button = gr.Button("클릭", elem_classes="minimal-button")
156
- space_rows.append((space_row, button, space))
157
 
158
- with gr.Column(scale=1):
159
- info_output = gr.Textbox(label="Space 정보 및 요약", lines=16)
160
- app_py_content = gr.Code(language="python", label="app.py 내용")
161
- screenshot_output = gr.Image(type="pil", label="Live 화면", height=360, width=540)
162
-
163
- for _, button, space in space_rows:
164
- button.click(
165
- lambda s=space: on_select(s),
166
- inputs=[],
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)}")
 
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
+ css = """
139
+ footer {visibility: hidden;}
140
+ .minimal-button {min-width: 30px !important; height: 25px !important; line-height: 1 !important; font-size: 12px !important; padding: 2px 5px !important;}
141
+ .space-row {margin-bottom: 5px !important;}
142
+ """
143
 
144
+ with gr.Blocks(css=css, theme="Nymbo/Nymbo_Theme") as demo:
145
+ gr.Markdown("# Hugging Face Most Liked Spaces")
 
 
 
 
 
 
 
 
 
 
146
 
147
+ with gr.Row():
148
+ with gr.Column(scale=1):
149
+ space_rows = []
150
+ for space in formatted_spaces:
151
+ with gr.Row(elem_classes="space-row") as space_row:
152
+ with gr.Column():
153
+ gr.Markdown(f"{space['name']} by {space['author']} (Likes: {space['likes']})", elem_classes="space-info")
154
+ button = gr.Button("클릭", elem_classes="minimal-button")
155
+ space_rows.append((space_row, button, space))
156
+
157
+ with gr.Column(scale=1):
158
+ info_output = gr.Textbox(label="Space 정보 및 요약", lines=16)
159
+ app_py_content = gr.Code(language="python", label="app.py 내용")
160
+ screenshot_output = gr.Image(type="pil", label="Live 화면", height=360, width=540)
161
+
162
+ for _, button, space in space_rows:
163
+ button.click(
164
+ lambda s=space: on_select(s),
165
+ inputs=[],
166
+ outputs=[info_output, app_py_content, screenshot_output]
167
+ )
168
+
169
+ return demo
170
 
171
  except Exception as e:
172
  print(f"Error in create_ui: {str(e)}")