phenomenon1981 commited on
Commit
35a553f
1 Parent(s): 76af469

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -4,10 +4,7 @@ import sys
4
  from pathlib import Path
5
  import random
6
  import string
7
- from ratelimiter import RateLimiter
8
-
9
- # rate limit to 4 calls per second
10
- rate_limiter = RateLimiter(max_calls=1, period=1)
11
 
12
  text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
13
 
@@ -22,50 +19,50 @@ def add_random_noise(prompt, noise_level=0.1):
22
 
23
  def send_it1(inputs, noise_level, proc1=proc1):
24
  prompt_with_noise = add_random_noise(inputs, noise_level)
25
- rate_limiter()
26
- output1 = proc1(prompt_with_noise)
27
  return output1
28
 
29
  def send_it2(inputs, noise_level, proc1=proc1):
30
  prompt_with_noise = add_random_noise(inputs, noise_level)
31
- rate_limiter()
32
  output2 = proc1(prompt_with_noise)
 
33
  return output2
34
 
35
  def send_it3(inputs, noise_level, proc1=proc1):
36
  prompt_with_noise = add_random_noise(inputs, noise_level)
37
- rate_limiter()
38
  output3 = proc1(prompt_with_noise)
 
39
  return output3
40
 
41
  def send_it4(inputs, noise_level, proc1=proc1):
42
  prompt_with_noise = add_random_noise(inputs, noise_level)
43
- rate_limiter()
44
  output4 = proc1(prompt_with_noise)
 
45
  return output4
46
 
47
  def send_it5(inputs, noise_level, proc5=proc5):
48
  prompt_with_noise = add_random_noise(inputs, noise_level)
49
- rate_limiter()
50
  output5 = proc5(prompt_with_noise)
 
51
  return output5
52
 
53
  def send_it6(inputs, noise_level, proc5=proc5):
54
  prompt_with_noise = add_random_noise(inputs, noise_level)
55
- rate_limiter()
56
  output6 = proc5(prompt_with_noise)
 
57
  return output6
58
 
59
  def send_it7(inputs, noise_level, proc5=proc5):
60
  prompt_with_noise = add_random_noise(inputs, noise_level)
61
- rate_limiter()
62
  output7 = proc5(prompt_with_noise)
 
63
  return output7
64
 
65
  def send_it8(inputs, noise_level, proc5=proc5):
66
  prompt_with_noise = add_random_noise(inputs, noise_level)
67
- rate_limiter()
68
  output8 = proc5(prompt_with_noise)
 
69
  return output8
70
 
71
 
 
4
  from pathlib import Path
5
  import random
6
  import string
7
+ import Time
 
 
 
8
 
9
  text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
10
 
 
19
 
20
  def send_it1(inputs, noise_level, proc1=proc1):
21
  prompt_with_noise = add_random_noise(inputs, noise_level)
22
+ output1=proc1(prompt_with_noise)
23
+ time.sleep(3)
24
  return output1
25
 
26
  def send_it2(inputs, noise_level, proc1=proc1):
27
  prompt_with_noise = add_random_noise(inputs, noise_level)
 
28
  output2 = proc1(prompt_with_noise)
29
+ time.sleep(3)
30
  return output2
31
 
32
  def send_it3(inputs, noise_level, proc1=proc1):
33
  prompt_with_noise = add_random_noise(inputs, noise_level)
 
34
  output3 = proc1(prompt_with_noise)
35
+ time.sleep(3)
36
  return output3
37
 
38
  def send_it4(inputs, noise_level, proc1=proc1):
39
  prompt_with_noise = add_random_noise(inputs, noise_level)
 
40
  output4 = proc1(prompt_with_noise)
41
+ time.sleep(3)
42
  return output4
43
 
44
  def send_it5(inputs, noise_level, proc5=proc5):
45
  prompt_with_noise = add_random_noise(inputs, noise_level)
 
46
  output5 = proc5(prompt_with_noise)
47
+ time.sleep(3)
48
  return output5
49
 
50
  def send_it6(inputs, noise_level, proc5=proc5):
51
  prompt_with_noise = add_random_noise(inputs, noise_level)
 
52
  output6 = proc5(prompt_with_noise)
53
+ time.sleep(3)
54
  return output6
55
 
56
  def send_it7(inputs, noise_level, proc5=proc5):
57
  prompt_with_noise = add_random_noise(inputs, noise_level)
 
58
  output7 = proc5(prompt_with_noise)
59
+ time.sleep(3)
60
  return output7
61
 
62
  def send_it8(inputs, noise_level, proc5=proc5):
63
  prompt_with_noise = add_random_noise(inputs, noise_level)
 
64
  output8 = proc5(prompt_with_noise)
65
+ time.sleep(3)
66
  return output8
67
 
68