Update app.py
Browse files
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 |
-
|
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 |
-
|
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=
|
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()
|