Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -153,7 +153,6 @@ def create_ui():
|
|
153 |
|
154 |
formatted_spaces = format_spaces(spaces_list)
|
155 |
print(f"Total spaces loaded: {len(formatted_spaces)}") # ๋๋ฒ๊น
์ถ๋ ฅ
|
156 |
-
|
157 |
|
158 |
css = """
|
159 |
footer {
|
@@ -180,22 +179,6 @@ def create_ui():
|
|
180 |
}
|
181 |
"""
|
182 |
|
183 |
-
def on_select(space):
|
184 |
-
try:
|
185 |
-
summary = summarize_space(space)
|
186 |
-
app_content = get_app_py_content(space['id'])
|
187 |
-
info = f"์ ํ๋ Space: {space['name']} (ID: {space['id']})\n"
|
188 |
-
info += f"Author: {space['author']}\n"
|
189 |
-
info += f"Likes: {space['likes']}\n"
|
190 |
-
info += f"Hardware: {space['hardware']}\n"
|
191 |
-
info += f"URL: {space['url']}\n\n"
|
192 |
-
info += f"์์ฝ:\n{summary}"
|
193 |
-
return info, app_content
|
194 |
-
except Exception as e:
|
195 |
-
print(f"Error in on_select: {str(e)}")
|
196 |
-
print(traceback.format_exc())
|
197 |
-
return f"์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค: {str(e)}", ""
|
198 |
-
|
199 |
with gr.Blocks(css=css, theme="Nymbo/Nymbo_Theme") as demo:
|
200 |
gr.Markdown("# Hugging Face Most Liked Spaces")
|
201 |
|
@@ -205,9 +188,9 @@ def create_ui():
|
|
205 |
for space in formatted_spaces:
|
206 |
with gr.Row(elem_classes="space-row") as space_row:
|
207 |
if space['thumbnail']:
|
208 |
-
gr.Image(value=space['thumbnail'],
|
209 |
else:
|
210 |
-
gr.Image(value="https://huggingface.co/front/assets/huggingface_logo-noborder.svg",
|
211 |
with gr.Column():
|
212 |
gr.Markdown(f"{space['name']} by {space['author']} (Likes: {space['likes']})", elem_classes="space-info")
|
213 |
gr.Markdown(f"Hardware: {space['hardware']}", elem_classes="hardware-info")
|
|
|
153 |
|
154 |
formatted_spaces = format_spaces(spaces_list)
|
155 |
print(f"Total spaces loaded: {len(formatted_spaces)}") # ๋๋ฒ๊น
์ถ๋ ฅ
|
|
|
156 |
|
157 |
css = """
|
158 |
footer {
|
|
|
179 |
}
|
180 |
"""
|
181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
with gr.Blocks(css=css, theme="Nymbo/Nymbo_Theme") as demo:
|
183 |
gr.Markdown("# Hugging Face Most Liked Spaces")
|
184 |
|
|
|
188 |
for space in formatted_spaces:
|
189 |
with gr.Row(elem_classes="space-row") as space_row:
|
190 |
if space['thumbnail']:
|
191 |
+
gr.Image(value=space['thumbnail'], width=100, height=100, show_label=False, elem_classes="thumbnail")
|
192 |
else:
|
193 |
+
gr.Image(value="https://huggingface.co/front/assets/huggingface_logo-noborder.svg", width=100, height=100, show_label=False, elem_classes="thumbnail")
|
194 |
with gr.Column():
|
195 |
gr.Markdown(f"{space['name']} by {space['author']} (Likes: {space['likes']})", elem_classes="space-info")
|
196 |
gr.Markdown(f"Hardware: {space['hardware']}", elem_classes="hardware-info")
|