Skip to content
Merged
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
14 changes: 11 additions & 3 deletions docs/extras/code_samples/v2_split.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from mindee import ClientV2, SplitParameters, SplitResponse, PathInput
from mindee import (
ClientV2,
PathInput,
SplitParameters,
SplitResponse,
)

input_path = "/path/to/the/file.ext"
api_key = "MY_API_KEY"
Expand All @@ -7,7 +12,7 @@ model_id = "MY_SPLIT_MODEL_ID"
# Init a new client
mindee_client = ClientV2(api_key)

# Set inference parameters
# Set parameters
params = SplitParameters(
# ID of the model, required.
model_id=model_id,
Expand All @@ -16,7 +21,7 @@ params = SplitParameters(
# Load a file from disk
input_source = PathInput(input_path)

# Send for processing
# Send for processing using polling
response = mindee_client.enqueue_and_get_result(
SplitResponse,
input_source,
Expand All @@ -25,3 +30,6 @@ response = mindee_client.enqueue_and_get_result(

# Print a brief summary of the parsed data
print(response.inference)

# Access the split result
splits: list = response.inference.result.splits