Please add more context on the AMLRequest and AMLResponse classes
まだ誰も着手していません。
評価
- 難易度
- 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.
- ID: 024b6cd8-a404-ede4-0425-8f538550493d
- Version Independent ID: 5b5490ce-34df-acdc-fbce-49e6f9374acc
- Content: azureml.contrib.services.aml_request.AMLRequest class - Azure Machine Learning Python
- Content Source: AzureML-Docset/stable/docs-ref-autogen/azureml-contrib-services/azureml.contrib.services.aml_request.AMLRequest.yml
- Service: machine-learning
- Sub-service: core
- GitHub Login: @DebFro
- Microsoft Alias: debfro
- 主要言語
- Jupyter Notebook
- スター
- 4.4k
- フォーク
- 2.6k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure/MachineLearningNotebooks のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Azure/MachineLearningNotebooks#1975 · コメント 1 件 ·
-
duplicates オープン
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
Azure/MachineLearningNotebooks#1960 ·
-
machine オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
Azure/MachineLearningNotebooks#1987 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Azure/MachineLearningNotebooks#1985 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Azure/MachineLearningNotebooks#1981 · リアクション 1 件 ·
Azure/MachineLearningNotebooks の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
certification
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
bisq-network/support#2181 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
tutorial updates オープン
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
sveltejs/svelte.dev#2241 ·