ysharma HF staff commited on
Commit
27c65f9
·
1 Parent(s): d84dcfb
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -12,16 +12,16 @@ from diffusers import StableDiffusionPipeline
12
 
13
  submissions_list = list_models(filter=["dreambooth-hackathon", category], full=True)
14
  spaces_pipeline_load = [submission.id for submission in submissions_list ]
15
- for ids in spaces_pipeline_load:
16
- mydict[ids] = StableDiffusionPipeline.from_pretrained(ids) #('ashiqabdulkhader/shiba-dog')
17
  #f"pipeline{ids.split('//')[-1]}" = StableDiffusionPipeline.from_pretrained(ids) #('ashiqabdulkhader/shiba-dog')
18
 
19
  #pipeline = StableDiffusionPipeline.from_pretrained("ashiqabdulkhader/shiba-dog") #('pharma/sugar-glider')
20
  #image = pipeline().images[0]
21
  #image
22
  #https://huggingface.co/ashiqabdulkhader/shiba-dog
23
- def filter_species(species):
24
- return gr.Dropdown.update(choices=species_map[species], value=species_map[species][1]), gr.update(visible=True)
25
 
26
  # %% app.ipynb 1
27
  def make_clickable_demo(model_name, prompt): #link=None):
@@ -39,7 +39,7 @@ def make_clickable_model(model_name, link=None):
39
  #adding functionality for demo
40
  prompt = "a photo of " + ' '.join(model_name.split('/')[-1].split['-']) + str(prompt)
41
  pipeline = StableDiffusionPipeline.from_pretrained(model_name) #("ashiqabdulkhader/shiba-dog") #('pharma/sugar-glider')
42
- image_demo = pipeline().images[0]
43
 
44
  # Remove user from model name
45
  return image_out.Update(value=image_demo, label=model_name.split("/")[-1]) #f'<a target="_blank" href="{link}">{model_name.split("/")[-1]}</a>'
 
12
 
13
  submissions_list = list_models(filter=["dreambooth-hackathon", category], full=True)
14
  spaces_pipeline_load = [submission.id for submission in submissions_list ]
15
+ #for ids in spaces_pipeline_load:
16
+ # mydict[ids] = StableDiffusionPipeline.from_pretrained(ids) #('ashiqabdulkhader/shiba-dog')
17
  #f"pipeline{ids.split('//')[-1]}" = StableDiffusionPipeline.from_pretrained(ids) #('ashiqabdulkhader/shiba-dog')
18
 
19
  #pipeline = StableDiffusionPipeline.from_pretrained("ashiqabdulkhader/shiba-dog") #('pharma/sugar-glider')
20
  #image = pipeline().images[0]
21
  #image
22
  #https://huggingface.co/ashiqabdulkhader/shiba-dog
23
+ def filter_species(species):
24
+ return gr.Dropdown.update(choices=species_map[species], value=species_map[species][1]), gr.update(visible=True)
25
 
26
  # %% app.ipynb 1
27
  def make_clickable_demo(model_name, prompt): #link=None):
 
39
  #adding functionality for demo
40
  prompt = "a photo of " + ' '.join(model_name.split('/')[-1].split['-']) + str(prompt)
41
  pipeline = StableDiffusionPipeline.from_pretrained(model_name) #("ashiqabdulkhader/shiba-dog") #('pharma/sugar-glider')
42
+ image_demo = pipeline(prompt).images[0]
43
 
44
  # Remove user from model name
45
  return image_out.Update(value=image_demo, label=model_name.split("/")[-1]) #f'<a target="_blank" href="{link}">{model_name.split("/")[-1]}</a>'