Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
import socketserver
|
|
|
|
|
|
|
2 |
|
3 |
class TCPHandler(socketserver.StreamRequestHandler):
|
4 |
"""
|
@@ -21,11 +24,21 @@ class TCPHandler(socketserver.StreamRequestHandler):
|
|
21 |
self.wfile.write(self.bytes.upper())
|
22 |
|
23 |
|
24 |
-
if __name__ == "__main__":
|
25 |
-
HOST, PORT = "localhost", 9999
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import socketserver
|
2 |
+
import multiprocessing as mp
|
3 |
+
|
4 |
+
print("Started App.")
|
5 |
|
6 |
class TCPHandler(socketserver.StreamRequestHandler):
|
7 |
"""
|
|
|
24 |
self.wfile.write(self.bytes.upper())
|
25 |
|
26 |
|
|
|
|
|
27 |
|
28 |
+
HOST, PORT = "localhost", 9999
|
29 |
+
def serverActivate():
|
30 |
+
with socketserver.TCPServer((HOST, PORT), TCPHandler) as server:
|
31 |
+
server.serve_forever()
|
32 |
+
|
33 |
+
def start():
|
34 |
+
import gradio as gr
|
35 |
+
|
36 |
+
def op():
|
37 |
+
return ""
|
38 |
+
|
39 |
+
demo = gr.Interface(fn=greet, outputs="textbox")
|
40 |
+
|
41 |
+
demo.launch(share=True)
|
42 |
+
|
43 |
+
mp.Process(start).start()
|
44 |
+
mp.Process(serverActivate).start()
|