Ashrafb commited on
Commit
3918c2b
·
1 Parent(s): 5e862e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -52,9 +52,13 @@ def send_it1(inputs, noise_level, proc=proc1):
52
  prompt_with_noise = add_random_noise(inputs, noise_level) + f" - {timestamp}"
53
  while queue.qsize() >= queue_threshold:
54
  time.sleep(2)
55
- queue.put(prompt_with_noise)
56
- output = proc(prompt_with_noise)
57
- return output
 
 
 
 
58
  import random
59
 
60
  import random
 
52
  prompt_with_noise = add_random_noise(inputs, noise_level) + f" - {timestamp}"
53
  while queue.qsize() >= queue_threshold:
54
  time.sleep(2)
55
+ try:
56
+ output = proc(prompt_with_noise)
57
+ return output
58
+ except Exception as e:
59
+ print(f"An error occurred: {e}")
60
+ return "An error occurred. Please try again later."
61
+
62
  import random
63
 
64
  import random