Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,58 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
# Configuration
|
| 4 |
COMMUNITY_NAME = "TinyModels 🤏⚡"
|
| 5 |
LOGO_PATH = "Com logo.png"
|
| 6 |
DESCRIPTION = """
|
| 7 |
### Big intelligence. Tiny Parameters.
|
| 8 |
**TinyModels** is a collaborative space dedicated to building small, fast, production-ready models
|
| 9 |
that punch way above their weight. No bloat. No nonsense.
|
| 10 |
-
|
| 11 |
*Just models that work — on your laptop, your phone, or your API.*
|
| 12 |
"""
|
| 13 |
|
| 14 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
with gr.Blocks(css="style.css", theme=gr.themes.Soft()) as app:
|
| 16 |
with gr.Column(elem_id="card"):
|
| 17 |
-
# Display the Logo
|
| 18 |
gr.Image(
|
| 19 |
value=LOGO_PATH,
|
| 20 |
elem_id="logo-img",
|
|
@@ -22,15 +60,11 @@ with gr.Blocks(css="style.css", theme=gr.themes.Soft()) as app:
|
|
| 22 |
container=False,
|
| 23 |
interactive=False
|
| 24 |
)
|
| 25 |
-
|
| 26 |
-
# Display Title and Description
|
| 27 |
gr.Markdown(f"## {COMMUNITY_NAME}")
|
| 28 |
gr.Markdown(DESCRIPTION, elem_classes="desc-text")
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
|
| 32 |
-
gr.Button("Explore Models", variant="primary", link="https://huggingface.co/TinyModels")
|
| 33 |
-
gr.Button("Join Community", variant="secondary", link="https://huggingface.co/join/TinyModels")
|
| 34 |
|
| 35 |
-
if __name__
|
| 36 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
| 3 |
COMMUNITY_NAME = "TinyModels 🤏⚡"
|
| 4 |
LOGO_PATH = "Com logo.png"
|
| 5 |
DESCRIPTION = """
|
| 6 |
### Big intelligence. Tiny Parameters.
|
| 7 |
**TinyModels** is a collaborative space dedicated to building small, fast, production-ready models
|
| 8 |
that punch way above their weight. No bloat. No nonsense.
|
|
|
|
| 9 |
*Just models that work — on your laptop, your phone, or your API.*
|
| 10 |
"""
|
| 11 |
|
| 12 |
+
# Use a custom CSS class for the buttons (style them in style.css)
|
| 13 |
+
BUTTON_STYLE = """
|
| 14 |
+
<style>
|
| 15 |
+
.custom-button {
|
| 16 |
+
display: inline-block;
|
| 17 |
+
padding: 10px 20px;
|
| 18 |
+
margin: 5px;
|
| 19 |
+
border-radius: 8px;
|
| 20 |
+
font-weight: bold;
|
| 21 |
+
text-decoration: none;
|
| 22 |
+
transition: background-color 0.3s ease;
|
| 23 |
+
}
|
| 24 |
+
.primary-btn {
|
| 25 |
+
background-color: #8A2BE2;
|
| 26 |
+
color: white;
|
| 27 |
+
}
|
| 28 |
+
.primary-btn:hover {
|
| 29 |
+
background-color: #7B1FA2;
|
| 30 |
+
}
|
| 31 |
+
.secondary-btn {
|
| 32 |
+
background-color: #E0E0E0;
|
| 33 |
+
color: #333;
|
| 34 |
+
}
|
| 35 |
+
.secondary-btn:hover {
|
| 36 |
+
background-color: #BDBDBD;
|
| 37 |
+
}
|
| 38 |
+
</style>
|
| 39 |
+
"""
|
| 40 |
+
|
| 41 |
+
def create_buttons():
|
| 42 |
+
return gr.HTML(
|
| 43 |
+
f"""
|
| 44 |
+
{BUTTON_STYLE}
|
| 45 |
+
<a href="https://huggingface.co/TinyModels" target="_blank" class="custom-button primary-btn">
|
| 46 |
+
Explore Models
|
| 47 |
+
</a>
|
| 48 |
+
<a href="https://huggingface.co/join/TinyModels" target="_blank" class="custom-button secondary-btn">
|
| 49 |
+
Join Community
|
| 50 |
+
</a>
|
| 51 |
+
"""
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
with gr.Blocks(css="style.css", theme=gr.themes.Soft()) as app:
|
| 55 |
with gr.Column(elem_id="card"):
|
|
|
|
| 56 |
gr.Image(
|
| 57 |
value=LOGO_PATH,
|
| 58 |
elem_id="logo-img",
|
|
|
|
| 60 |
container=False,
|
| 61 |
interactive=False
|
| 62 |
)
|
|
|
|
|
|
|
| 63 |
gr.Markdown(f"## {COMMUNITY_NAME}")
|
| 64 |
gr.Markdown(DESCRIPTION, elem_classes="desc-text")
|
| 65 |
|
| 66 |
+
# Replace broken gr.Button calls with a custom HTML block
|
| 67 |
+
create_buttons()
|
|
|
|
|
|
|
| 68 |
|
| 69 |
+
# No if __name__ guard – simpler and Space‑friendly
|
| 70 |
+
app.launch(server_name="0.0.0.0", server_port=7860)
|