Update app.py
Browse files
app.py
CHANGED
|
@@ -50,7 +50,8 @@ def send_it1(inputs, noise_level, proc=proc1):
|
|
| 50 |
request_counter += 1
|
| 51 |
timestamp = f"{time.time()}_{request_counter}"
|
| 52 |
prompt_with_noise = add_random_noise(inputs, noise_level) + f" - {timestamp}"
|
| 53 |
-
|
|
|
|
| 54 |
while queue.qsize() >= queue_threshold:
|
| 55 |
time.sleep(2)
|
| 56 |
queue.put(prompt_with_noise)
|
|
@@ -58,7 +59,7 @@ def send_it1(inputs, noise_level, proc=proc1):
|
|
| 58 |
return output
|
| 59 |
except Exception as e:
|
| 60 |
# Display a generic error message to the user
|
| 61 |
-
raise gr.Error("Experiencing high demand. Please retry shortly. Thank you for your patience.")
|
| 62 |
|
| 63 |
def get_prompts(prompt_text):
|
| 64 |
if not prompt_text:
|
|
|
|
| 50 |
request_counter += 1
|
| 51 |
timestamp = f"{time.time()}_{request_counter}"
|
| 52 |
prompt_with_noise = add_random_noise(inputs, noise_level) + f" - {timestamp}"
|
| 53 |
+
|
| 54 |
+
try:
|
| 55 |
while queue.qsize() >= queue_threshold:
|
| 56 |
time.sleep(2)
|
| 57 |
queue.put(prompt_with_noise)
|
|
|
|
| 59 |
return output
|
| 60 |
except Exception as e:
|
| 61 |
# Display a generic error message to the user
|
| 62 |
+
raise gr.Error("Experiencing high demand. Please retry shortly. Thank you for your patience.")
|
| 63 |
|
| 64 |
def get_prompts(prompt_text):
|
| 65 |
if not prompt_text:
|