Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ def run_command(command):
|
|
30 |
command,
|
31 |
stdout=subprocess.PIPE,
|
32 |
stderr=subprocess.PIPE,
|
33 |
-
bufsize=1,
|
34 |
universal_newlines=False
|
35 |
)
|
36 |
|
@@ -88,14 +88,16 @@ def process_model(ft_model_id: str, base_model_id: str, rank: str, private_repo,
|
|
88 |
|
89 |
with tempfile.TemporaryDirectory(dir="outputs") as outputdir:
|
90 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
91 |
-
|
92 |
"mergekit-extract-lora",
|
93 |
ft_model_id,
|
94 |
base_model_id,
|
95 |
outputdir,
|
96 |
f"--rank={rank}",
|
97 |
f"--device={device}"
|
98 |
-
]
|
|
|
|
|
99 |
print("returncode", returncode)
|
100 |
print("output_stdout", output_stdout)
|
101 |
print("output_stderr", output_stderr)
|
|
|
30 |
command,
|
31 |
stdout=subprocess.PIPE,
|
32 |
stderr=subprocess.PIPE,
|
33 |
+
#bufsize=1,
|
34 |
universal_newlines=False
|
35 |
)
|
36 |
|
|
|
88 |
|
89 |
with tempfile.TemporaryDirectory(dir="outputs") as outputdir:
|
90 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
91 |
+
cmd = [
|
92 |
"mergekit-extract-lora",
|
93 |
ft_model_id,
|
94 |
base_model_id,
|
95 |
outputdir,
|
96 |
f"--rank={rank}",
|
97 |
f"--device={device}"
|
98 |
+
]
|
99 |
+
print("cmd", cmd)
|
100 |
+
(returncode, output_stdout, output_stderr) = run_command()
|
101 |
print("returncode", returncode)
|
102 |
print("output_stdout", output_stdout)
|
103 |
print("output_stderr", output_stderr)
|