【问题标题】:How connect Azure Function with my own model? It is possible to use Azure Storage?如何将 Azure Function 与我自己的模型连接起来?可以使用 Azure 存储吗?
【发布时间】:2021-04-11 16:01:03
【问题描述】:

简介

我在本地创建了自己的模型,然后将其注册并部署到 azure 并且可以正常工作。

部署的模型输出:

我的方法

我使用了this tutorial,我想在 Azure Function 中使用我的模型,我可以做到:

def main(req: func.HttpRequest, msg: func.Out[func.QueueMessage]) -> str:
    name = req.params.get('name')
    scoring_uri = 'http://1f72b1bf-5ca9-42d9-bedd-f41773591a4f.francecentral.azurecontainer.io/score'
    headers = {'Content-Type':'application/json'}
    test_data = json.dumps({'text': 'Today is a great day!'})
    response = requests.post(scoring_uri, data=test_data, headers=headers)

if not name:
    try:
        req_body = req.get_json()
    except ValueError:
        pass
    else:
        name = req_body.get('name')

if name:
    msg.set(name)
    return func.HttpResponse(f"Hello {name}! Najlepszy wynik: {response.json()}")
else:
    return func.HttpResponse(
        "Please pass a name on the query string or in the request body",
        status_code=400
    )

问题

  1. 我的用法正确吗?
  2. 是否可以使用 Azure 存储进行模型存储以及如何使用?
  3. 还有其他方法可以在 Azure Function 中使用模型吗?

我想知道,因为我在要求中指定了我应该使用 azure 函数和 azure 存储。我不明白为什么。

【问题讨论】:

    标签: azure azure-functions azure-storage azure-machine-learning-service


    【解决方案1】:

    目前,将 ML 模型部署到 Azure Functions 处于预览阶段。 https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-functions

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-13
      • 2021-02-27
      • 2017-12-09
      • 2021-09-27
      • 2013-01-05
      • 1970-01-01
      • 2011-01-29
      相关资源
      最近更新 更多