Spaces:
Runtime error
Runtime error
Deactivate queue for user history retrieval
Browse filesRetrieving the user history is currently counted as a "heavy task" that is queued in the queue as the image-generation. Adding `queue=False` allows users to retrieve their history without waiting in the queue. This should not impact the Space performances as retrieving the history is just a matter of reading a file on the disk (+ there is also a filelock in the history to prevent concurrency).
cc
@dome272
app.py
CHANGED
|
@@ -241,7 +241,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 241 |
outputs=result,
|
| 242 |
api_name="run",
|
| 243 |
).then(
|
| 244 |
-
fn=fetch_gallery_history, inputs=[prompt, result], outputs=history
|
| 245 |
)
|
| 246 |
negative_prompt.submit(
|
| 247 |
fn=randomize_seed_fn,
|
|
@@ -255,7 +255,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 255 |
outputs=result,
|
| 256 |
api_name=False,
|
| 257 |
).then(
|
| 258 |
-
fn=fetch_gallery_history, inputs=[prompt, result], outputs=history
|
| 259 |
)
|
| 260 |
run_button.click(
|
| 261 |
fn=randomize_seed_fn,
|
|
@@ -269,7 +269,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 269 |
outputs=result,
|
| 270 |
api_name=False,
|
| 271 |
).then(
|
| 272 |
-
fn=fetch_gallery_history, inputs=[prompt, result], outputs=history
|
| 273 |
)
|
| 274 |
|
| 275 |
if __name__ == "__main__":
|
|
|
|
| 241 |
outputs=result,
|
| 242 |
api_name="run",
|
| 243 |
).then(
|
| 244 |
+
fn=fetch_gallery_history, inputs=[prompt, result], outputs=history, queue=False
|
| 245 |
)
|
| 246 |
negative_prompt.submit(
|
| 247 |
fn=randomize_seed_fn,
|
|
|
|
| 255 |
outputs=result,
|
| 256 |
api_name=False,
|
| 257 |
).then(
|
| 258 |
+
fn=fetch_gallery_history, inputs=[prompt, result], outputs=history, queue=False
|
| 259 |
)
|
| 260 |
run_button.click(
|
| 261 |
fn=randomize_seed_fn,
|
|
|
|
| 269 |
outputs=result,
|
| 270 |
api_name=False,
|
| 271 |
).then(
|
| 272 |
+
fn=fetch_gallery_history, inputs=[prompt, result], outputs=history, queue=False
|
| 273 |
)
|
| 274 |
|
| 275 |
if __name__ == "__main__":
|