Spaces:
Runtime error
Runtime error
Commit
Β·
b607519
1
Parent(s):
a71f59a
add pixi check and install
Browse files
app.py
CHANGED
|
@@ -1,7 +1,21 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import subprocess
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
PIXI_PATH = Path("/home/user/.pixi/bin/pixi")
|
| 5 |
|
| 6 |
+
def check_and_install_pixi():
|
| 7 |
+
try:
|
| 8 |
+
subprocess.check_call("pixi --version", shell=True)
|
| 9 |
+
except subprocess.CalledProcessError:
|
| 10 |
+
print("pixi not found. Installing pixi...")
|
| 11 |
+
# Install pixi using the provided installation script
|
| 12 |
+
subprocess.check_call("curl -fsSL https://pixi.sh/install.sh | bash", shell=True)
|
| 13 |
|
| 14 |
+
if __name__ == "__main__":
|
| 15 |
+
check_and_install_pixi()
|
| 16 |
+
|
| 17 |
+
def greet(name):
|
| 18 |
+
return "Hello " + name + "!!"
|
| 19 |
+
|
| 20 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 21 |
+
demo.launch()
|