Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
msaroufim committed Feb 20, 2023
1 parent b776a5c commit ebe4cf8
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ private void setupModelDependencies(Model model)

String pythonRuntime = EnvironmentUtils.getPythonRunTime(model);

String packageInstallCommand =
pythonRuntime
+ " -m pip install -U -t "
+ model.getModelDir().getAbsolutePath()
+ " -r "
+ requirementsFilePath; // NOPMD

String[] envp =
EnvironmentUtils.getEnvString(
configManager.getModelServerHome(),
Expand All @@ -223,17 +230,7 @@ private void setupModelDependencies(Model model)
.map(e -> e.split("=", 2))
.collect(Collectors.toMap(e -> e[0], e -> e[1]));

ProcessBuilder pb =
new ProcessBuilder(
pythonRuntime,
"-m",
"pip",
"install",
"-U",
"-t",
model.getModelDir().getAbsolutePath(),
"-r",
requirementsFilePath);
ProcessBuilder pb = new ProcessBuilder(packageInstallCommand);
pb.environment().putAll(env);
pb.directory(model.getModelDir().getAbsoluteFile());

Expand Down

0 comments on commit ebe4cf8

Please sign in to comment.