Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Please add more context on the AMLRequest and AMLResponse classes

Đang mở
#1,905 0 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python

Hướng nghiên cứu

Bắt đầu với các trang tham chiếu về AMLRequest và AMLResponse cùng tệp nguồn AzureML-Docset/stable/docs-ref-autogen/azureml.contrib.services.aml_request.AMLRequest.yml; so sánh chúng với mẫu online-endpoints-binary-payloads.ipynb được liên kết. Ghi lại các tham số, thuộc tính liên quan và cách sử dụng mẫu để truyền JSON cùng với một tệp nhị phân và truy cập tệp đó trong scoring script.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I am testing the sample https://github.com/Azure/azureml-examples/blob/main/sdk/python/endpoints/online/managed/online-endpoints-binary-payloads.ipynb
As per the documentation, the AMLRequest and AMLResponse classes were inherited from flask.wrappers. However, please also add the parameters and attributes and sample usage of these classes.

If I am sending a JSON object to the MOE (Managed Online Endpoint) along with the binary image file, the request object will hold these values passed as raw httprequest.

payload = {"file-metadata": {
    "filename": "my-image.jpg",
    "file-size": "150kb",
    ...
}}
res = requests.post(
    url=scoring_uri,
    headers={"Authorization": f"Bearer {key}"},
    json=payload, **attempt to pass the payload to the request**
    files=[
        ("file", open("my-image.jpg", "rb"))
    ],
)

How to pass a JSON payload to this request and access that from within the scoring script? I tried to configure the json parameter to assign a sample JSON payload as above sample. However, when viewing the value through req.get_json() in the scoring script, this function returns empty.

@rawhttp
def run(req : AMLRequest):
    print(req.get_json()) **nothing gets printed out**

I found a workaround to assign the payload to the headers parameter as follows. However, it would be appreciated if you may also include the correct approach/sample usage of the above class(es).

payload = {"file-metadata": {
    "filename": "my-image.jpg",
    "file-size": "150kb",
    ...
}}

headers_ = {"Authorization": f"Bearer {key}", "File-Metadata": json.dumps(payload)}

res = requests.post(
    url=scoring_uri,
    headers=headers_
    ...)

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Ngôn ngữ chính
Jupyter Notebook
Star
4.4k
Fork
2.6k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/MachineLearningNotebooks

Tất cả issue của Azure/MachineLearningNotebooks

Issue tương tự

Thêm issue về Documentation

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.