YongLD commited on
Commit
71cefe5
1 Parent(s): 8a3ba61

add example

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -19,7 +19,7 @@ def filename_from_text(text: str) -> str:
19
  def log_gpu_memory():
20
  print(subprocess.check_output('nvidia-smi').decode('utf-8'))
21
 
22
- ## log_gpu_memory()
23
 
24
  model = MinDalle(
25
  is_mega=True,
@@ -28,7 +28,7 @@ model = MinDalle(
28
  dtype=torch.float32
29
  )
30
 
31
- ## log_gpu_memory()
32
 
33
  def run_model(
34
  text: str,
@@ -83,7 +83,7 @@ def run_model(
83
  is_verbose = True
84
  )
85
 
86
- ## log_gpu_memory()
87
 
88
  ext = 'png' if bool(save_as_png) else 'jpg'
89
  filename = filename_from_text(text)
@@ -161,6 +161,9 @@ with demo:
161
  examples=[
162
  ['A white cat with golden sunglasses on, pink background, studio lighting, 4k, award winning photography', 2, 'examples/cat.png'],
163
  ['an astronaut dancing on the moon’s surface, close-up photo', 2, 'examples/astronaut.png'],
 
 
 
164
  ],
165
  inputs=[
166
  input_text,
 
19
  def log_gpu_memory():
20
  print(subprocess.check_output('nvidia-smi').decode('utf-8'))
21
 
22
+ log_gpu_memory()
23
 
24
  model = MinDalle(
25
  is_mega=True,
 
28
  dtype=torch.float32
29
  )
30
 
31
+ log_gpu_memory()
32
 
33
  def run_model(
34
  text: str,
 
83
  is_verbose = True
84
  )
85
 
86
+ log_gpu_memory()
87
 
88
  ext = 'png' if bool(save_as_png) else 'jpg'
89
  filename = filename_from_text(text)
 
161
  examples=[
162
  ['A white cat with golden sunglasses on, pink background, studio lighting, 4k, award winning photography', 2, 'examples/cat.png'],
163
  ['an astronaut dancing on the moon’s surface, close-up photo', 2, 'examples/astronaut.png'],
164
+ ['A photo of a Samoyed dog with its tongue out hugging a white Siamese cat', 5, 'examples/dog.png'],
165
+ ['Dragons of Earth, Wind, Fire, powering up a huge sphere of compressed energy, digital art', 2, 'examples/dragon.png'],
166
+ ['A snowboarder jumping in the air while coming down a ski mountain, concept art, artstation, unreal engine, 3d render, HD, Bokeh', 3, 'examples/snow.png'],
167
  ],
168
  inputs=[
169
  input_text,