Deploy models with Hugging Face Inference Endpoints

  Рет қаралды 15,157

Julien Simon

Julien Simon

Жыл бұрын

In this video, I show you how to deploy Transformer models straight from the Hugging Face hub to managed infrastructure on AWS, in just a few clicks. Starting from a model that I already trained for image classification, I first deploy an endpoint protected by Hugging Face token authentication. Then, I deploy a second endpoint in a private subnet, and I show you how to access it securely from your AWS account thanks to AWS PrivateLink.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) www.buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Model: huggingface.co/juliensimon/au...
- Inference Endpoints: huggingface.co/inference-endp...
- Inference Endpoints documentation: huggingface.co/docs/inference...
- AWS PrivateLink documentation: docs.aws.amazon.com/vpc/lates...
Code:
import requests, json, os
API_URL = ENDPOINT_URL
MY_API_TOKEN = os.getenv("MY_API_TOKEN")
headers = {"Authorization": "Bearer "+MY_API_TOKEN, "Content-Type": "image/jpg"}
def query(filename):
with open(filename, "rb") as f:
data = f.read()
response = requests.request("POST", API_URL, headers=headers, data=data)
return json.loads(response.content.decode("utf-8"))
output = query("food.jpg")

Пікірлер: 30
@50kT
@50kT Жыл бұрын
This is the exact content I was looking for yesterday, you posted it today! Fantastic lol Really hope I can get everything set up to put my idea into production at scale.
@juliensimonfr
@juliensimonfr Жыл бұрын
Glad it was helpful!
@caiyu538
@caiyu538 Жыл бұрын
I need to recheck your previous video. There are deployment of training instance. Now it is to deploy inference instance. Always great to revisit to understand different terms for a beginner.
@caiyu538
@caiyu538 Жыл бұрын
Thank you for hugging face. It makes deployment much easier.
@grandplazaunited
@grandplazaunited Жыл бұрын
Thanks Julien. Besides ease of using hugging face endpoints, i learned about how VPC endpoints work!
@juliensimonfr
@juliensimonfr Жыл бұрын
Cool :)
@caiyu538
@caiyu538 Жыл бұрын
great lectures.
@danielminchev4173
@danielminchev4173 Жыл бұрын
This is pure gold, thank you!
@juliensimonfr
@juliensimonfr 10 ай бұрын
Thanks!
@arunvijay8949
@arunvijay8949 5 ай бұрын
Fantastic , great learning thank you very much. So now I can use these endpoints from Langchain or lllama Index without worrying about the deployment of my model.
@juliensimonfr
@juliensimonfr 5 ай бұрын
Exactly, and you're welcome :)
@connorshorten6311
@connorshorten6311 Жыл бұрын
Thanks Julien, great video!
@juliensimonfr
@juliensimonfr Жыл бұрын
Glad you liked it!
@sandiegoman
@sandiegoman Жыл бұрын
Ughh, I wish I had found this earlier. I created my own VPS with both front end and back end server to provide access to a transformer model. Thanks, this should help.
@juliensimonfr
@juliensimonfr 10 ай бұрын
Glad I could help!
@datasciencesolutions2361
@datasciencesolutions2361 Жыл бұрын
Great job sincerely!
@juliensimonfr
@juliensimonfr Жыл бұрын
Thanks!
@moneyjuice
@moneyjuice Жыл бұрын
That's amazing, Merci pour le partage
@juliensimonfr
@juliensimonfr Жыл бұрын
Glad you liked it.
@innocentanyaele5986
@innocentanyaele5986 4 ай бұрын
You're the best!!!
@juliensimonfr
@juliensimonfr 4 ай бұрын
Thanks, I'll tell my wife
@nb9t7
@nb9t7 Ай бұрын
Hey Julien, Where can we find the training model video for food dataset? Also, I am trying to use a model and deploy it on Hugging Face Inference, but it errors out saying I need a config.json file. I'm not sure how to create it. Any leads would be really helpful. Thanks!
@blockchaingeek7118
@blockchaingeek7118 Жыл бұрын
I'll appreciate if you share how to deploy models .ckpt or safetansors on a vps that I already own (vultr or digitalocean)
@user-mb6uv8ih4c
@user-mb6uv8ih4c 6 ай бұрын
In this we need AWS for model storage , or we can directly use by the inference api endpoints of hugging face , because I want to use jais13b-chat model @Julien Simon
@juliensimonfr
@juliensimonfr 6 ай бұрын
Inference Endpoints lets you deploy any hub model on managed infrastructure running on AWS or Azure. Not sure what you mean by 'model storage' ?
@FushigiMigi
@FushigiMigi 11 күн бұрын
Need to know how to communicate with chat models that are running using python code. I’m struggling to find this information.
@juliensimonfr
@juliensimonfr 11 күн бұрын
Check out the Inference Endpoints documentation. The format is simple JSON.
@efexzium
@efexzium 11 ай бұрын
paying for it but Its reaaaaaallly hard to change the tokens for models.
@hskhawaja
@hskhawaja 7 ай бұрын
Where do I get my api token?
@juliensimonfr
@juliensimonfr 6 ай бұрын
Create an account on the Hugging Face hub and go to settings.
SageMaker JumpStart: deploy Hugging Face models in minutes!
8:23
Unlimited AI Agents running locally with Ollama & AnythingLLM
15:21
Tim Carambat
Рет қаралды 107 М.
Inside Out Babies (Inside Out Animation)
00:21
FASH
Рет қаралды 23 МЛН
哈莉奎因以为小丑不爱她了#joker #cosplay #Harriet Quinn
00:22
佐助与鸣人
Рет қаралды 7 МЛН
Inside Out 2: Who is the strongest? Joy vs Envy vs Anger #shorts #animation
00:22
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 10 МЛН
The Best Way to Deploy AI Models (Inference Endpoints)
5:47
Serving Machine Learning models with Google Vertex AI
17:35
ML Engineer
Рет қаралды 9 М.
host ALL your AI locally
24:20
NetworkChuck
Рет қаралды 936 М.
The cloud is over-engineered and overpriced (no music)
14:39
Tom Delalande
Рет қаралды 527 М.
How to configure AWS CLI keys
8:21
Hitesh Choudhary
Рет қаралды 5 М.
AWS Sagemaker tutorial | Build and deploy a Machine Learning API with Python
53:32
Computer vision engineer
Рет қаралды 10 М.
Best operating system for Servers in 2024
11:41
VirtualizationHowto
Рет қаралды 43 М.
How I Would Learn AWS Today (after 10 years of cloud experience)
40:28
Be A Better Dev
Рет қаралды 386 М.
Это iPhone 16
0:52
Wylsacom
Рет қаралды 628 М.
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 1,7 МЛН
#samsung #retrophone #nostalgia #x100
0:14
mobijunk
Рет қаралды 14 МЛН
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 7 МЛН
Ba Travel Smart Phone Charger
0:42
Tech Official
Рет қаралды 1,2 МЛН