hysts HF staff commited on
Commit
b90fae3
1 Parent(s): fbfab15
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +2 -13
  3. requirements.txt +2 -2
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🌖
4
  colorFrom: gray
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 3.44.4
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: gray
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 3.45.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -128,7 +128,8 @@ with gr.Blocks(css="style.css") as demo:
128
  cache_examples=CACHE_EXAMPLES,
129
  )
130
 
131
- prompt.submit(
 
132
  fn=randomize_seed_fn,
133
  inputs=[seed, randomize_seed],
134
  outputs=seed,
@@ -140,18 +141,6 @@ with gr.Blocks(css="style.css") as demo:
140
  outputs=result,
141
  api_name="run",
142
  )
143
- run_button.click(
144
- fn=randomize_seed_fn,
145
- inputs=[seed, randomize_seed],
146
- outputs=seed,
147
- queue=False,
148
- api_name=False,
149
- ).then(
150
- fn=generate,
151
- inputs=inputs,
152
- outputs=result,
153
- api_name=False,
154
- )
155
 
156
  if __name__ == "__main__":
157
  demo.queue(max_size=10).launch()
 
128
  cache_examples=CACHE_EXAMPLES,
129
  )
130
 
131
+ gr.on(
132
+ triggers=[prompt.submit, run_button.click],
133
  fn=randomize_seed_fn,
134
  inputs=[seed, randomize_seed],
135
  outputs=seed,
 
141
  outputs=result,
142
  api_name="run",
143
  )
 
 
 
 
 
 
 
 
 
 
 
 
144
 
145
  if __name__ == "__main__":
146
  demo.queue(max_size=10).launch()
requirements.txt CHANGED
@@ -1,9 +1,9 @@
1
  accelerate==0.23.0
2
  diffusers==0.21.2
3
- gradio==3.44.4
4
  huggingface-hub==0.17.2
5
  imageio[ffmpeg]==2.31.3
6
- spaces==0.14.0
7
  torch==2.0.0
8
  torchvision==0.15.1
9
  transformers==4.33.2
 
1
  accelerate==0.23.0
2
  diffusers==0.21.2
3
+ gradio==3.45.2
4
  huggingface-hub==0.17.2
5
  imageio[ffmpeg]==2.31.3
6
+ spaces==0.15.0
7
  torch==2.0.0
8
  torchvision==0.15.1
9
  transformers==4.33.2