VictorSanh commited on
Commit
950a189
1 Parent(s): d3f2b30

introduce random sleep

Browse files
Files changed (1) hide show
  1. app_dialogue.py +2 -0
app_dialogue.py CHANGED
@@ -5,6 +5,7 @@ import hashlib
5
  import logging
6
  import os
7
  import re
 
8
  from pathlib import Path
9
  from typing import List, Optional, Tuple
10
  from urllib.parse import urlparse
@@ -791,6 +792,7 @@ with gr.Blocks(title="AI Meme Generator", theme=gr.themes.Base(), css=css) as de
791
  text_at_the_top,
792
  generation_args,
793
  ):
 
794
  text = client.generate(prompt=query, **generation_args).generated_text
795
  if image is not None and text != "":
796
  meme_image = make_meme_image(
 
5
  import logging
6
  import os
7
  import re
8
+ import time
9
  from pathlib import Path
10
  from typing import List, Optional, Tuple
11
  from urllib.parse import urlparse
 
792
  text_at_the_top,
793
  generation_args,
794
  ):
795
+ time.sleep(random.uniform(0, 1))
796
  text = client.generate(prompt=query, **generation_args).generated_text
797
  if image is not None and text != "":
798
  meme_image = make_meme_image(