Please add more context on the AMLRequest and AMLResponse classes
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- documentation, machine-learning
Direzione di ricerca
Inizia dalle pagine di riferimento di AMLRequest e AMLResponse e dal file sorgente AzureML-Docset/stable/docs-ref-autogen/azureml.contrib.services.aml_request.AMLRequest.yml; confrontali con l'esempio collegato online-endpoints-binary-payloads.ipynb. Documenta i parametri, gli attributi e l'utilizzo di esempio pertinenti per passare JSON insieme a un file binario e accedervi nello script di scoring.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Jupyter Notebook
- Stelle
- 4.4k
- Fork
- 2.6k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/MachineLearningNotebooks
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Azure/MachineLearningNotebooks#1975 · 1 commento ·
-
duplicates Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Azure/MachineLearningNotebooks#1960 ·
-
machine Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
Azure/MachineLearningNotebooks#1987 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Azure/MachineLearningNotebooks#1985 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Azure/MachineLearningNotebooks#1981 · 1 reazione ·
Tutte le issue di Azure/MachineLearningNotebooks
Issue simili
-
Area: Excel support
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
orbeon/orbeon-forms#7893 ·
-
Theme loads third-party resources on every page (jsdelivr web font, cdnjs Font Awesome) – GDPR Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
docToolchain/docToolchain#1705 ·
-
kb-infra-drift
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
OCHA-DAP/ds-knowledge-base#653 · 1 commento ·
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Claiming namespace: rasy007 Apertanamespace operations
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
EclipseFdn/open-vsx.org#13419 ·