Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
|
145 |
-
|
146 |
-
|
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.
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
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)}")
|