Skip to content

Commit

Permalink
Changing python path and back to single executor
Browse files Browse the repository at this point in the history
  • Loading branch information
justine-gehring committed Sep 8, 2023
1 parent bcc7292 commit a7e2bf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/moderne/ai/EmbeddingModelClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import static java.util.Objects.requireNonNull;

public class EmbeddingModelClient {
private static final ExecutorService EXECUTOR_SERVICE = Executors.newFixedThreadPool(3);
private static final ExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadExecutor();
private static final Path MODELS_DIR = Paths.get(System.getProperty("user.home") + "/.moderne/models");

@Nullable
Expand Down Expand Up @@ -73,7 +73,7 @@ private void start() {
Files.copy(requireNonNull(EmbeddingModelClient.class.getResourceAsStream("/torch_model")), torchPath, StandardCopyOption.REPLACE_EXISTING);
StringWriter sw = new StringWriter();
PrintWriter procOut = new PrintWriter(sw);
String cmd = String.format("python3 %s/get_is_related.py", MODELS_DIR);
String cmd = String.format("/usr/bin/python3 %s/get_is_related.py", MODELS_DIR);
Process proc = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", cmd});
EXECUTOR_SERVICE.submit(() -> {
new BufferedReader(new InputStreamReader(proc.getInputStream())).lines()
Expand Down

0 comments on commit a7e2bf1

Please sign in to comment.