Hugging Face 模型部署

huangapple go评论93阅读模式
英文:

Hugging Face model deployment

问题

我的问题与如何部署Hugging Face模型相关。我最近下载了Falcon 7B Instruct模型,并在我的Colab中运行了它。然而,当我尝试加载模型并希望生成文本时,它需要大约40秒才能给我输出。我只是想知道如何在生产环境中部署这些模型,以便以低延迟获取输出。我对MLOps还不太熟悉,所以我只是想探索一下。此外,部署该模型将产生什么费用?如果有许多用户同时使用该模型怎么办?我该如何处理?将非常感激您的回应。

我正在使用的代码来自https://huggingface.co/tiiuae/falcon-7b-instruct

另外,我将模型权重保存在Google Drive中。

英文:

My question is related to how one deploys the Hugging Face model. I recently downloaded the Falcon 7B Instruct model and ran it in my Colab. However, when I am trying to load the model and want it to generate text, it takes about 40 seconds to give me an output. I was just wondering how we deploy these models in production then so that it gives us output with low latency. I am new to MLOps so I just want to explore. Also, what will be the charges of deploying that model? What if many users are simultaneously using this model? How will I handle that? Will greatly appreciate the response.

The code I am using is from the <https://huggingface.co/tiiuae/falcon-7b-instruct>.

Also, I am saving the model weights locally in a Google Drive.

答案1

得分: 1

  • 我只是想知道如何将这些模型部署到生产环境中,以便以低延迟提供输出。

您可以下载该模型并在本地使用,以避免与互联网连接相关的任何延迟。请注意,您的输入需要进行处理,因此正常情况下需要一些时间才能给您响应。为了使其尽快运行,您需要在GPU上运行它(通常比CPU快数十倍)。

  • 此模型的部署费用会是多少?

您可以免费使用这些模型。

  • 如果许多用户同时使用这个模型会怎么样?

我从未遇到过这种问题,但如果您想避免任何问题,可以再次下载模型并从本地加载。

英文:
  • I was just wondering how we deploy these models in production then so that it gives us output with low latency.

You can download the model and use it locally, to avoid any kind of latency related to Internet connection. Notice that you input has to be processed, so it is normal to take some time to give you a response. To make it as quick as possible, you have to run it on GPUs (typically dozens of times faster that CPUs).

  • Also, what will be the charges of deploying that model?

You can use the models for free.

  • What if many users are simultaneously using this model?

I have never experienced issues of this kind, but if you want to avoid any kind of problem, once again, you can download the model and load it from local.

huangapple
  • 本文由 发表于 2023年7月20日 13:57:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76727040.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定