Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Please add more context on the AMLRequest and AMLResponse classes

オープン
#1,905 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

AMLRequest と AMLResponse のリファレンス ページ、およびソース ファイル AzureML-Docset/stable/docs-ref-autogen/azureml.contrib.services.aml_request.AMLRequest.yml から始め、リンクされている online-endpoints-binary-payloads.ipynb のサンプルと比較します。JSON をバイナリ ファイルとともに渡し、scoring script でそれにアクセスするために関連するパラメーター、属性、サンプル使用方法を文書化します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Jupyter Notebook
スター
4.4k
フォーク
2.6k
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/MachineLearningNotebooks のほかの issue

Azure/MachineLearningNotebooks の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。