Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close client in order to prevent file handle leak #317

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class MinExample {

InferenceServerClient client = new InferenceServerClient("0.0.0.0:8000", 5000, 5000);
InferResult result = client.infer("roberta", inputs, outputs);
client.close();
float[] logits = result.getOutputAsFloat("logits");
System.out.println(Arrays.toString(logits));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public static void main(String[] args) throws Exception

InferenceServerClient client = new InferenceServerClient("0.0.0.0:8000", 5000, 5000);
InferResult result = client.infer("custom_identity_int32", inputs, outputs);
client.close();

// Get the output arrays from the results and verify
int[] output0 = result.getOutputAsInt("OUTPUT0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public static void main(String[] args) throws Exception

InferenceServerClient client = new InferenceServerClient("0.0.0.0:8000", 5000, 5000);
InferResult result = client.infer("simple", inputs, outputs);
client.close();

// Get the output arrays from the results
int[] op0 = result.getOutputAsInt("OUTPUT0");
Expand Down