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

Handle raw binary request in python #7741

Open
remiruzn opened this issue Oct 24, 2024 · 0 comments
Open

Handle raw binary request in python #7741

remiruzn opened this issue Oct 24, 2024 · 0 comments

Comments

@remiruzn
Copy link

I faced with problem. Description about use raw binary data here. But i don't understand how i can receive data with my TritonPythonModel class.
Example image send:

import requests
url = "http://localhost:8000/v2/models/inference_pipeline_bytearray/infer"
Read the binary data from a file
with open("image.jpg", "rb") as f:
    binary_data = f.read()

headers = {
    "Content-Type": "application/octet-stream",
    "Inference-Header-Content-Length": "0",
    "Content-Length": str(len(binary_data)),
}

response = requests.post(url, headers=headers, data=binary_data)
print(response.text)`

How i cant receive with my TritonPythonModel?

class TritonPythonModel:
     .....
    def execute(self, requests):
        responses = []
        for request in requests:
             binary_data = ?
        .....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant