Spaces:
Sleeping
Sleeping
pablovela5620
commited on
Commit
•
f6fe9bf
1
Parent(s):
dce517a
add lsof package and check port 7860 before hand
Browse files- app.py +5 -0
- packages.txt +1 -0
- pixi_app.py +1 -1
app.py
CHANGED
@@ -15,6 +15,11 @@ def pixi_run():
|
|
15 |
command = f"{PIXI_PATH} run app"
|
16 |
subprocess.check_call(command, shell=True)
|
17 |
|
|
|
|
|
|
|
|
|
18 |
if __name__ == "__main__":
|
19 |
check_and_install_pixi()
|
|
|
20 |
pixi_run()
|
|
|
15 |
command = f"{PIXI_PATH} run app"
|
16 |
subprocess.check_call(command, shell=True)
|
17 |
|
18 |
+
def check_port_and_kill():
|
19 |
+
command = "lsof -t -i:7860 | xargs kill"
|
20 |
+
subprocess.check_call(command, shell=True)
|
21 |
+
|
22 |
if __name__ == "__main__":
|
23 |
check_and_install_pixi()
|
24 |
+
check_port_and_kill()
|
25 |
pixi_run()
|
packages.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
lsof
|
pixi_app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
def greet(name):
|
3 |
-
return "Hello " + name + "!!"
|
4 |
|
5 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
6 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
def greet(name):
|
3 |
+
return "Hello pixi" + name + "!!"
|
4 |
|
5 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
6 |
demo.launch()
|