Reverent commited on
Commit
4ac0888
·
1 Parent(s): e09a781

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -32,14 +32,9 @@ def warmer():
32
  print("NO INTERNET")
33
  print(str(e))
34
 
35
- counter = 0
36
  def restart():
37
- global counter
38
  while True:
39
- counter = 0
40
- while counter <= 86400: #Restart Space every 24 hours
41
- counter += 1
42
- time.sleep(1)
43
  try:
44
  text_output,image_output = client.predict(
45
  "atleiwarm0003", # str in 'message' Textbox component
@@ -53,13 +48,12 @@ def restart():
53
  print(str(e))
54
 
55
  def placeholder(dummy):
56
- global counter
57
- return counter
58
 
59
  t = Thread(target=warmer)
60
  r = Thread(target=restart)
61
  t.start()
62
  r.start()
63
 
64
- iface = gr.Interface(fn=placeholder, inputs="text", outputs=counter)
65
  iface.launch()
 
32
  print("NO INTERNET")
33
  print(str(e))
34
 
 
35
  def restart():
 
36
  while True:
37
+ time.sleep(86400)
 
 
 
38
  try:
39
  text_output,image_output = client.predict(
40
  "atleiwarm0003", # str in 'message' Textbox component
 
48
  print(str(e))
49
 
50
  def placeholder(dummy):
51
+ return "lol"
 
52
 
53
  t = Thread(target=warmer)
54
  r = Thread(target=restart)
55
  t.start()
56
  r.start()
57
 
58
+ iface = gr.Interface(fn=placeholder, inputs="text", outputs="text")
59
  iface.launch()