timpearce commited on
Commit
3079056
·
1 Parent(s): 39cb733

Try to fix torch dtype

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -17,16 +17,12 @@ if not AUTH_TOKEN:
17
  device = "cuda" if torch.cuda.is_available() else "cpu"
18
  if device == "cuda":
19
  print('Nvidia GPU detected!')
20
- share = True
21
  pipe = StableDiffusionPipeline.from_pretrained(
22
  model_id,
23
  use_auth_token=AUTH_TOKEN,
24
- revision="fp16",
25
- torch_dtype=torch.float16
26
  )
27
  else:
28
  print('No Nvidia GPU in system!')
29
- share = False
30
  pipe = StableDiffusionPipeline.from_pretrained(
31
  model_id,
32
  use_auth_token=AUTH_TOKEN
@@ -260,7 +256,7 @@ with block:
260
  rounded=(True, False, False, True),
261
  container=False,
262
  )
263
- btn = gr.Button("Generate image").style(
264
  margin=False,
265
  rounded=(False, True, True, False),
266
  full_width=False,
@@ -322,4 +318,4 @@ Despite how impressive being able to turn text into image is, beware to the fact
322
  """
323
  )
324
 
325
- block.queue(max_size=10).launch(share=share, enable_queue=True)
 
17
  device = "cuda" if torch.cuda.is_available() else "cpu"
18
  if device == "cuda":
19
  print('Nvidia GPU detected!')
 
20
  pipe = StableDiffusionPipeline.from_pretrained(
21
  model_id,
22
  use_auth_token=AUTH_TOKEN,
 
 
23
  )
24
  else:
25
  print('No Nvidia GPU in system!')
 
26
  pipe = StableDiffusionPipeline.from_pretrained(
27
  model_id,
28
  use_auth_token=AUTH_TOKEN
 
256
  rounded=(True, False, False, True),
257
  container=False,
258
  )
259
+ btn = gr.Button("Generate a Gina photo").style(
260
  margin=False,
261
  rounded=(False, True, True, False),
262
  full_width=False,
 
318
  """
319
  )
320
 
321
+ block.queue(max_size=10).launch(share=False, enable_queue=True)