sasha HF staff commited on
Commit
7022131
β€’
1 Parent(s): 1f0a5fb

stripping it down to the booones

Browse files
Files changed (1) hide show
  1. app.py +11 -69
app.py CHANGED
@@ -1,26 +1,8 @@
1
- # AUTOGENERATED! DO NOT EDIT! File to edit: app.ipynb.
2
-
3
- # %% auto 0
4
- __all__ = ['block', 'make_clickable_model', 'make_clickable_user', 'get_submissions']
5
-
6
- # %% app.ipynb 0
7
  import gradio as gr
8
  import pandas as pd
9
  from huggingface_hub import list_models
10
 
11
- # %% app.ipynb 1
12
- def make_clickable_model(model_name, link=None):
13
- if link is None:
14
- link = "https://huggingface.co/" + model_name
15
- # Remove user from model name
16
- return f'<a target="_blank" href="{link}">{model_name.split("/")[-1]}</a>'
17
-
18
-
19
- def make_clickable_user(user_id):
20
- link = "https://huggingface.co/" + user_id
21
- return f'<a target="_blank" href="{link}">{user_id}</a>'
22
 
23
- # %% app.ipynb 2
24
  def get_submissions(category):
25
  submissions = list_models(filter=["dreambooth-hackathon", category], full=True)
26
  leaderboard_models = []
@@ -42,80 +24,40 @@ def get_submissions(category):
42
  return df
43
 
44
  # %% app.ipynb 3
45
- block = gr.Blocks()
46
 
47
- with block:
48
  gr.Markdown(
49
- """# The DreamBooth Hackathon Leaderboard
50
-
51
- Welcome to the leaderboard for the DreamBooth Hackathon! This is a community event where particpants **personalise a Stable Diffusion model** by fine-tuning it with a powerful technique called [_DreamBooth_](https://arxiv.org/abs/2208.12242). This technique allows one to implant a subject (e.g. your pet or favourite dish) into the output domain of the model such that it can be synthesized with a _unique identifier_ in the prompt.
52
-
53
- This competition is composed of 5 _themes_, where each theme will collect models belong to one of the categories shown in the tabs below. We'll be **giving out prizes to the top 3 most liked models per theme**, and you're encouraged to submit as many models as you want!
54
-
55
- For details on how to participate, check out the hackathon's guide [here](https://github.com/huggingface/diffusion-models-class/blob/main/hackathon/README.md).
56
- """
57
  )
58
  with gr.Tabs():
59
- with gr.TabItem("Animal 🐨"):
60
  with gr.Row():
61
  animal_data = gr.components.Dataframe(
62
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
63
  )
64
- with gr.Row():
65
- data_run = gr.Button("Refresh")
66
- data_run.click(
67
- get_submissions, inputs=gr.Variable("animal"), outputs=animal_data
68
- )
69
- with gr.TabItem("Science πŸ”¬"):
70
  with gr.Row():
71
  science_data = gr.components.Dataframe(
72
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
73
  )
74
- with gr.Row():
75
- data_run = gr.Button("Refresh")
76
- data_run.click(
77
- get_submissions, inputs=gr.Variable("science"), outputs=science_data
78
- )
79
- with gr.TabItem("Food πŸ”"):
80
  with gr.Row():
81
  food_data = gr.components.Dataframe(
82
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
83
  )
84
- with gr.Row():
85
- data_run = gr.Button("Refresh")
86
- data_run.click(
87
- get_submissions, inputs=gr.Variable("food"), outputs=food_data
88
- )
89
- with gr.TabItem("Landscape πŸ”"):
90
  with gr.Row():
91
  landscape_data = gr.components.Dataframe(
92
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
93
  )
94
- with gr.Row():
95
- data_run = gr.Button("Refresh")
96
- data_run.click(
97
- get_submissions,
98
- inputs=gr.Variable("landscape"),
99
- outputs=landscape_data,
100
- )
101
- with gr.TabItem("Wilcard πŸ”₯"):
102
  with gr.Row():
103
  wildcard_data = gr.components.Dataframe(
104
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
105
  )
106
- with gr.Row():
107
- data_run = gr.Button("Refresh")
108
- data_run.click(
109
- get_submissions,
110
- inputs=gr.Variable("wildcard"),
111
- outputs=wildcard_data,
112
- )
113
-
114
- block.load(get_submissions, inputs=gr.Variable("animal"), outputs=animal_data)
115
- block.load(get_submissions, inputs=gr.Variable("science"), outputs=science_data)
116
- block.load(get_submissions, inputs=gr.Variable("food"), outputs=food_data)
117
- block.load(get_submissions, inputs=gr.Variable("landscape"), outputs=landscape_data)
118
- block.load(get_submissions, inputs=gr.Variable("wildcard"), outputs=wildcard_data)
119
 
120
 
121
- block.launch()
 
 
 
 
 
 
 
1
  import gradio as gr
2
  import pandas as pd
3
  from huggingface_hub import list_models
4
 
 
 
 
 
 
 
 
 
 
 
 
5
 
 
6
  def get_submissions(category):
7
  submissions = list_models(filter=["dreambooth-hackathon", category], full=True)
8
  leaderboard_models = []
 
24
  return df
25
 
26
  # %% app.ipynb 3
27
+ demo = gr.Blocks()
28
 
29
+ with demo:
30
  gr.Markdown(
31
+ """# Energy Star Leaderboard
32
+
33
+ TODO """
 
 
 
 
 
34
  )
35
  with gr.Tabs():
36
+ with gr.TabItem("Text Generation πŸ’¬"):
37
  with gr.Row():
38
  animal_data = gr.components.Dataframe(
39
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
40
  )
41
+ with gr.TabItem("Image Generation πŸ“·"):
 
 
 
 
 
42
  with gr.Row():
43
  science_data = gr.components.Dataframe(
44
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
45
  )
46
+ with gr.TabItem("Text Classification 🎭"):
 
 
 
 
 
47
  with gr.Row():
48
  food_data = gr.components.Dataframe(
49
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
50
  )
51
+ with gr.TabItem("Image Classification πŸ–ΌοΈ"):
 
 
 
 
 
52
  with gr.Row():
53
  landscape_data = gr.components.Dataframe(
54
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
55
  )
56
+ with gr.TabItem("Extractive QA ❔"):
 
 
 
 
 
 
 
57
  with gr.Row():
58
  wildcard_data = gr.components.Dataframe(
59
  type="pandas", datatype=["number", "markdown", "markdown", "number"]
60
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
 
63
+ demo.launch()