AshanGimhana
commited on
Commit
•
e6b6a20
1
Parent(s):
7671949
Update app.py
Browse files
app.py
CHANGED
@@ -4,30 +4,6 @@ import subprocess
|
|
4 |
os.system("pip install gradio==3.50")
|
5 |
|
6 |
|
7 |
-
|
8 |
-
# Function to download and install Ninja
|
9 |
-
def install_ninja():
|
10 |
-
# Check if ninja is already installed
|
11 |
-
if subprocess.run(["ninja", "--version"], capture_output=True).returncode != 0:
|
12 |
-
print("Ninja not found, downloading...")
|
13 |
-
# Download Ninja
|
14 |
-
subprocess.run(["wget", "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip"], check=True)
|
15 |
-
|
16 |
-
# Unzip it
|
17 |
-
subprocess.run(["unzip", "ninja-linux.zip"], check=True)
|
18 |
-
|
19 |
-
# Move Ninja to a directory in PATH
|
20 |
-
os.rename("ninja", "/usr/local/bin/ninja") # You may need to change this path
|
21 |
-
print("Ninja installed successfully.")
|
22 |
-
|
23 |
-
# Call the function to install Ninja
|
24 |
-
install_ninja()
|
25 |
-
|
26 |
-
# Now, you can check if Ninja is installed
|
27 |
-
os.environ["PATH"] += os.pathsep + "/usr/local/bin"
|
28 |
-
print("Ninja version:", subprocess.run(["ninja", "--version"], capture_output=True).stdout.decode().strip())
|
29 |
-
|
30 |
-
|
31 |
from argparse import Namespace
|
32 |
import pprint
|
33 |
import numpy as np
|
|
|
4 |
os.system("pip install gradio==3.50")
|
5 |
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
from argparse import Namespace
|
8 |
import pprint
|
9 |
import numpy as np
|