---
title: "Creating document embeddings with Hugging Face's Transformers & Amazon SageMaker"
url: https://daily.dev/posts/creating-document-embeddings-with-hugging-face-s-transformers-amazon-sagemaker-6pqxygw9k
source_url: https://www.philschmid.de/custom-inference-huggingface-sagemaker
type: article
source: "Philipp Schmid"
published: 2026-05-31T07:41:00.703Z
updated: 2026-05-31T08:31:00.335Z
tags: ["python", "aws"]
reading_time: 4
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating document embeddings with Hugging Face's Transformers & Amazon SageMaker

**[Philipp Schmid](https://daily.dev/sources/philschmid)** · 4 min read · 0 upvotes · 0 comments

## Summary

A step-by-step guide to deploying a custom real-time inference endpoint on Amazon SageMaker using Hugging Face's Inference DLCs and Sentence Transformers for generating document embeddings. Covers writing a custom inference.py script to override default model loading and prediction methods, packaging model artifacts into a model.tar.gz archive, uploading to S3, and deploying a HuggingFaceModel endpoint. Uses the sentence-transformers/all-MiniLM-L6-v2 model with mean pooling to produce 384-dimensional dense vector embeddings suitable for semantic search and clustering.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.philschmid.de/custom-inference-huggingface-sagemaker>

---

Tags: [#python](https://daily.dev/tags/python), [#aws](https://daily.dev/tags/aws)

[View this post on daily.dev](https://daily.dev/posts/creating-document-embeddings-with-hugging-face-s-transformers-amazon-sagemaker-6pqxygw9k)
