ritwikbiswas commited on
Commit
e59b8dc
1 Parent(s): 42cd0c7

remove diffusion

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,11 +1,12 @@
1
  import gradio as gr
2
  import os
3
  import openai
4
- from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
5
  import torch
6
 
7
  model_id = "stabilityai/stable-diffusion-2-1"
8
- pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
 
9
  # pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
10
  # pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
11
  # pipe = pipe.to("cuda")
@@ -33,9 +34,9 @@ def generate_prompt(radio,word1,word2):
33
  )['choices'][0]['text']
34
 
35
  response_txt = response.replace('\n','')
36
- diffusion_in = f'a dramatic painting of: {response_txt.split(".")[0]}'
37
- image = pipe(diffusion_in).images[0]
38
- return response_txt, image
39
 
40
  demo = gr.Interface(
41
  generate_prompt,
@@ -46,7 +47,7 @@ demo = gr.Interface(
46
  # gr.Dropdown(team_list, value=[team_list[random.randint(1,30)]], multiselect=True),
47
  # gr.Checkbox(label="Is it the morning?"),
48
  ],
49
- ["text","image"],
50
  # "image",
51
  allow_flagging="never",
52
  title="GPT-3 Analogy Lab 🧪",
 
1
  import gradio as gr
2
  import os
3
  import openai
4
+ #from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
5
  import torch
6
 
7
  model_id = "stabilityai/stable-diffusion-2-1"
8
+ #pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
9
+
10
  # pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
11
  # pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
12
  # pipe = pipe.to("cuda")
 
34
  )['choices'][0]['text']
35
 
36
  response_txt = response.replace('\n','')
37
+ # diffusion_in = f'a dramatic painting of: {response_txt.split(".")[0]}'
38
+ # image = pipe(diffusion_in).images[0]
39
+ return response_txt, #image
40
 
41
  demo = gr.Interface(
42
  generate_prompt,
 
47
  # gr.Dropdown(team_list, value=[team_list[random.randint(1,30)]], multiselect=True),
48
  # gr.Checkbox(label="Is it the morning?"),
49
  ],
50
+ ["text"],#,"image"],
51
  # "image",
52
  allow_flagging="never",
53
  title="GPT-3 Analogy Lab 🧪",