ysharma HF staff commited on
Commit
76c8ebf
1 Parent(s): 4466abf
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -32,7 +32,7 @@ def make_clickable_demo(model_name, prompt): #link=None):
32
 
33
  return gr.Button.update()
34
 
35
- def make_clickable_model(model_name, link=None):
36
  if link is None:
37
  link = "https://huggingface.co/" + model_name
38
 
@@ -56,7 +56,7 @@ def make_clickable_user(user_id):
56
  return f'<a target="_blank" href="{link}">{user_id}</a>'
57
 
58
  # %% app.ipynb 2
59
- def get_submissions(category):
60
  submissions = list_models(filter=["dreambooth-hackathon", category], full=True)
61
  leaderboard_models = []
62
 
@@ -66,7 +66,7 @@ def get_submissions(category):
66
  leaderboard_models.append(
67
  (
68
  make_clickable_user(user_id),
69
- make_clickable_model(submission.id),
70
  submission.likes,
71
  )
72
  )
@@ -91,7 +91,7 @@ with block:
91
  """
92
  )
93
  with gr.Row():
94
- prompt_in = gr.Textbox(label="Type in a Prompt. This will be suffixed to 'a photo of <model name>', so prompt accordingly -")
95
  #button_in = gr.Button(label = "Generate Image using this model")
96
  with gr.Tabs():
97
  with gr.TabItem("Animal 🐨"):
@@ -102,7 +102,7 @@ with block:
102
  with gr.Row():
103
  data_run = gr.Button("Refresh")
104
  data_run.click(
105
- get_submissions, inputs=gr.Variable("animal"), outputs=animal_data
106
  )
107
 
108
 
@@ -151,7 +151,7 @@ with block:
151
  outputs=wildcard_data,
152
  )
153
 
154
- with gr.Row() as your_model_demo :
155
  image_out = gr.Image()
156
 
157
  #button_in.click(make_clickable_demo, prompt_in, your_model_demo)
 
32
 
33
  return gr.Button.update()
34
 
35
+ def make_clickable_model(model_name,prompt, link=None):
36
  if link is None:
37
  link = "https://huggingface.co/" + model_name
38
 
 
56
  return f'<a target="_blank" href="{link}">{user_id}</a>'
57
 
58
  # %% app.ipynb 2
59
+ def get_submissions(category, prompt):
60
  submissions = list_models(filter=["dreambooth-hackathon", category], full=True)
61
  leaderboard_models = []
62
 
 
66
  leaderboard_models.append(
67
  (
68
  make_clickable_user(user_id),
69
+ make_clickable_model(submission.id, prompt),
70
  submission.likes,
71
  )
72
  )
 
91
  """
92
  )
93
  with gr.Row():
94
+ prompt_in = gr.Textbox(label="Type in a Prompt. This will be suffixed to 'a photo of <model name>', so prompt accordingly -", value="")
95
  #button_in = gr.Button(label = "Generate Image using this model")
96
  with gr.Tabs():
97
  with gr.TabItem("Animal 🐨"):
 
102
  with gr.Row():
103
  data_run = gr.Button("Refresh")
104
  data_run.click(
105
+ get_submissions, inputs=[gr.Variable("animal"), prompt_in], outputs=animal_data
106
  )
107
 
108
 
 
151
  outputs=wildcard_data,
152
  )
153
 
154
+ with gr.Row() : #as your_model_demo :
155
  image_out = gr.Image()
156
 
157
  #button_in.click(make_clickable_demo, prompt_in, your_model_demo)