机器学习算法部署平台Cortex更新,支持TensorFlowPytorch等主流框架
Posted 新智元
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了机器学习算法部署平台Cortex更新,支持TensorFlowPytorch等主流框架相关的知识,希望对你有一定的参考价值。
AI WORLD 2019世界人工智能峰会明日开幕!
新智元报道
【新智元导读】机器学习算法部署平台Cortex发布版本更新,提供API自动扩展、多框架支持、运行日志传输,GPU和CPU基础设施均可使用,可以更方便快捷地将机器学习模型的预测结果用于生产环境。快来与AI大咖一起参与讨论吧~
主要功能和特性
# cortex.yaml
- kind: deployment
name: text
- kind: api
name: generator
model: s3://cortex-examples/text-generator/gpt-2/124M
request_handler: handler.py
# handler.py
from encoder import get_encoder
encoder = get_encoder()
def pre_inference(sample, metadata):
context = encoder.encode(sample["text"])
return {"context": [context]}
def post_inference(prediction, metadata):
response = prediction["sample"]
return encoder.decode(response)
$ cortex deploy
deployment started
$ cortex get generator --watch
status up-to-date available requested last update avg latency
live 1 1 1 8s 123ms
url: http://***.amazonaws.com/text/generator
$ curl http://***.amazonaws.com/text/generator \
-X POST -H "Content-Type: application/json" \
-d '{"text": "machine learning"}'
Machine learning, with more than one thousand researchers around the world today, are looking to create computer-driven machine learning algorithms that can also be applied to human and social problems, such as education, health care, employment, medicine, politics, or the environment...
以上是关于机器学习算法部署平台Cortex更新,支持TensorFlowPytorch等主流框架的主要内容,如果未能解决你的问题,请参考以下文章