Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,27 @@
|
|
1 |
import os
|
2 |
import subprocess
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
# Install flash attention
|
5 |
subprocess.run(
|
6 |
"pip install flash-attn --no-build-isolation",
|
|
|
1 |
import os
|
2 |
import subprocess
|
3 |
|
4 |
+
# Define the directory and repository URL
|
5 |
+
target_dir = "/inference"
|
6 |
+
repo_url = "https://huggingface.co/m-a-p/xcodec_mini_infer"
|
7 |
+
|
8 |
+
# Create the target directory if it doesn't exist
|
9 |
+
if not os.path.exists(target_dir):
|
10 |
+
os.makedirs(target_dir)
|
11 |
+
print(f"Created directory: {target_dir}")
|
12 |
+
else:
|
13 |
+
print(f"Directory already exists: {target_dir}")
|
14 |
+
|
15 |
+
# Change to the target directory
|
16 |
+
os.chdir(target_dir)
|
17 |
+
|
18 |
+
# Clone the repository using git
|
19 |
+
try:
|
20 |
+
subprocess.run(["git", "clone", repo_url], check=True)
|
21 |
+
print(f"Repository cloned successfully into {target_dir}")
|
22 |
+
except subprocess.CalledProcessError as e:
|
23 |
+
print(f"Failed to clone repository: {e}")
|
24 |
+
|
25 |
# Install flash attention
|
26 |
subprocess.run(
|
27 |
"pip install flash-attn --no-build-isolation",
|