บันทึกโมเดลลง Bento Store
ลงทะเบียนอาร์ติแฟกต์โมเดลด้วย BentoML
บันทึกโมเดลลง Bento Store เป็นบทเรียน MLOps Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน MLOps Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส MLOps Academy มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Meet BentoML
BentoML is a Python framework that packages and serves models with batching and scaling built in, so you skip a lot of boilerplate. 🚀
Install It
Getting started takes one command. You install bentoml from pip just like any other Python package.
pip install bentomlThe Bento Store
The Bento Store is a local registry on your machine. Every model you save lands there with a name and an automatic version tag.
Train Something First
You need a model before you can save one. Here you fit a simple scikit-learn classifier on some data.
from sklearn.svm import SVC
clf = SVC()
clf.fit(X, y)Save with the Framework API
BentoML ships a helper per framework. For scikit-learn you call bentoml.sklearn.save_model with a name and the fitted model.
import bentoml
bentoml.sklearn.save_model("iris_clf", clf)Names and Tags
Each save creates a tag like iris_clf:abc123. The name stays the same while the version after the colon changes every save.
Other Frameworks Too
The same pattern works everywhere. Swap the module to match your framework, like bentoml.pytorch or bentoml.xgboost.
bentoml.pytorch.save_model("net", model)List Your Models
You can see everything in the store from your terminal. The bentoml models list command shows names, tags, and sizes.
bentoml models listLoad It Back
To use a saved model you load it by tag. Passing latest grabs the newest version without hardcoding a hash.
model = bentoml.sklearn.load_model("iris_clf:latest")Attach Custom Metadata
You can stash extra info at save time. Adding metadata like accuracy travels with the model so teammates know what it is.
bentoml.sklearn.save_model("iris_clf", clf, metadata={"acc": 0.96})Clean Up Old Versions
The store can fill up over time. You prune anything you no longer need with the bentoml models delete command and a tag.
bentoml models delete iris_clf:abc123Quick Check
You just ran save_model twice for the same name. What identifies the two saves apart?
Recap
You installed BentoML, saved a model to the Bento Store with a framework helper, listed it, and loaded it back by tag. The model is now managed! 🙌
คำถามที่พบบ่อย
บทเรียน “บันทึกโมเดลลง Bento Store” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “บันทึกโมเดลลง Bento Store” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส MLOps Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส MLOps Academy มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “บันทึกโมเดลลง Bento Store”
ลงทะเบียนอาร์ติแฟกต์โมเดลด้วย BentoML คุณปฏิบัติ MLOps Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน MLOps Academy หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน MLOps Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน
บทเรียน “บันทึกโมเดลลง Bento Store” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน MLOps Academy นี้ได้ไหม
ได้ บทเรียน MLOps Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- บันทึกโมเดลลง Bento Store
- กำหนดบริการและ API ของบริการ
- เปิดใช้การประมวลผลแบบกลุ่มปรับตามคำขอ
- สร้าง Bento และทำให้เป็นคอนเทนเนอร์