Please add more context on the AMLRequest and AMLResponse classes
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
Línea de trabajo
Comienza con las páginas de referencia de AMLRequest y AMLResponse y con el archivo de origen AzureML-Docset/stable/docs-ref-autogen/azureml.contrib.services.aml_request.AMLRequest.yml; compáralos con el ejemplo enlazado online-endpoints-binary-payloads.ipynb. Documenta los parámetros, atributos y el uso de ejemplo relevantes para pasar JSON junto con un archivo binario y acceder a él en el script de scoring.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 4.4k
- Forks
- 2.6k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Azure/MachineLearningNotebooks
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Azure/MachineLearningNotebooks#1975 · 1 comentario ·
-
duplicates Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Azure/MachineLearningNotebooks#1960 ·
-
machine Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
Azure/MachineLearningNotebooks#1987 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Azure/MachineLearningNotebooks#1985 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Azure/MachineLearningNotebooks#1981 · 1 reacción ·
Todos los issues de Azure/MachineLearningNotebooks
Issues similares
-
The correction-threshold rationale says 17 restraint cases collide; the current corpus has 16 Abiertoarea:dictation documentation P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
uttrflow/uttrflow-swift#1180 ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
-
kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
falcosecurity/falco-website#1601 ·
-
Improve privacy considerations Abiertospecification
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
WICG/webmonetization#729 ·