Spaces:
Build error
Build error
Commit
Β·
947150a
0
Parent(s):
initial commit
Browse files- .gitignore +2 -0
- app.py +61 -0
- poetry.lock +0 -0
- pyproject.toml +18 -0
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.parquet
|
| 2 |
+
__pycache__/
|
app.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pandas as pd
|
| 3 |
+
|
| 4 |
+
# Load the spaces.parquet file as a dataframe
|
| 5 |
+
df = pd.read_parquet("spaces.parquet")
|
| 6 |
+
|
| 7 |
+
"""
|
| 8 |
+
Todos:
|
| 9 |
+
Create tabbed interface for filtering and graphs
|
| 10 |
+
plotly graph showing the growth of spaces over time
|
| 11 |
+
plotly graph showing the breakdown of spaces by sdk
|
| 12 |
+
plotly graph of colors
|
| 13 |
+
plotly graph of emojis
|
| 14 |
+
Plotly graph of hardware
|
| 15 |
+
Investigate README lengths
|
| 16 |
+
bar chart of the number of spaces per author
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def filtered_df(emoji, likes):
|
| 21 |
+
_df = df
|
| 22 |
+
# if emoji is not none, filter the dataframe with it
|
| 23 |
+
if emoji:
|
| 24 |
+
_df = _df[_df["emoji"].isin(emoji)]
|
| 25 |
+
# if likes is not none, filter the dataframe with it
|
| 26 |
+
if likes:
|
| 27 |
+
_df = _df[_df["likes"] >= likes]
|
| 28 |
+
return _df
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
with gr.Blocks() as demo:
|
| 32 |
+
df = df[df["stage"] == "RUNNING"]
|
| 33 |
+
emoji = gr.Dropdown(
|
| 34 |
+
df["emoji"].unique().tolist(), label="Search by Emoji π€", multiselect=True
|
| 35 |
+
) # Dropdown to select the emoji
|
| 36 |
+
likes = gr.Slider(
|
| 37 |
+
minimum=df["likes"].min(),
|
| 38 |
+
maximum=df["likes"].max(),
|
| 39 |
+
step=1,
|
| 40 |
+
label="Filter by Likes",
|
| 41 |
+
) # Slider to filter by likes
|
| 42 |
+
hardware = gr.Dropdown(
|
| 43 |
+
df["hardware"].unique().tolist(), label="Search by Hardware", multiselect=True
|
| 44 |
+
)
|
| 45 |
+
devMode = gr.Checkbox(value=False, label="DevMode Enabled")
|
| 46 |
+
clear = gr.ClearButton(components=[emoji])
|
| 47 |
+
|
| 48 |
+
df = pd.DataFrame(df[["emoji", "host", "likes", "hardware"]])
|
| 49 |
+
df["host"] = df["host"].apply(lambda x: f"<a href={x}>{x}</a>")
|
| 50 |
+
gr.DataFrame(filtered_df, inputs=[emoji, likes], datatype=["str", "html"])
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
print(df.head())
|
| 54 |
+
demo.launch()
|
| 55 |
+
|
| 56 |
+
""" id author created_at last_modified subdomain host likes sdk tags readme_size python_version license duplicated_from models datasets emoji colorFrom colorTo pinned stage hardware devMode custom_domains
|
| 57 |
+
2 52Hz/CMFNet_deblurring 52Hz 2022-03-02 23:29:35+00:00 2024-05-28 11:25:33+00:00 52hz-cmfnet-deblurring https://52hz-cmfnet-deblurring.hf.space 17 gradio [gradio] 924.0 None None None None None π» indigo indigo False RUNNING cpu-basic False []
|
| 58 |
+
3 52Hz/CMFNet_dehazing 52Hz 2022-03-02 23:29:35+00:00 2024-05-28 11:08:25+00:00 52hz-cmfnet-dehazing https://52hz-cmfnet-dehazing.hf.space 5 gradio [gradio] 917.0 None None None None None β gray gray False RUNNING cpu-basic False []
|
| 59 |
+
4 52Hz/CMFNet_deraindrop 52Hz 2022-03-02 23:29:35+00:00 2024-05-30 02:59:24+00:00 52hz-cmfnet-deraindrop https://52hz-cmfnet-deraindrop.hf.space 10 gradio [gradio] 920.0 None None None None None π¦ blue blue False RUNNING cpu-basic False []
|
| 60 |
+
5 52Hz/HWMNet_lowlight_enhancement 52Hz 2022-03-02 23:29:35+00:00 2023-05-31 06:37:21+00:00 52hz-hwmnet-lowlight-enhancement https://52hz-hwmnet-lowlight-enhancement.hf.space 8 gradio [gradio] 1286.0 None None None None None πΆ indigo None False RUNNING cpu-basic False []
|
| 61 |
+
7 52Hz/SRMNet_real_world_denoising 52Hz 2022-03-02 23:29:35+00:00 2023-05-31 10:03:04+00:00 52hz-srmnet-real-world-denoising https://52hz-srmnet-real-world-denoising.hf.space 17 gradio [gradio] 926.0 None None None None None πͺ pink yellow False RUNNING cpu-basic False []"""
|
poetry.lock
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pyproject.toml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[tool.poetry]
|
| 2 |
+
name = "spacesship"
|
| 3 |
+
version = "0.1.0"
|
| 4 |
+
description = ""
|
| 5 |
+
authors = ["jsulz <[email protected]>"]
|
| 6 |
+
license = "MIT"
|
| 7 |
+
readme = "README.md"
|
| 8 |
+
|
| 9 |
+
[tool.poetry.dependencies]
|
| 10 |
+
python = "^3.12"
|
| 11 |
+
gradio = "^4.42.0"
|
| 12 |
+
datasets = "^2.21.0"
|
| 13 |
+
pandas = "^2.2.2"
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
[build-system]
|
| 17 |
+
requires = ["poetry-core"]
|
| 18 |
+
build-backend = "poetry.core.masonry.api"
|