حفظ نموذج في Bento Store
سجّل أثر نموذج باستخدام BentoML.
حفظ نموذج في Bento Store درس مجاني في MLOps Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 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» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MLOps Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MLOps Academy 4 دروس في المجموع.
ماذا ستتعلم في «حفظ نموذج في Bento Store»؟
سجّل أثر نموذج باستخدام BentoML. تتمرن على MLOps Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ MLOps Academy؟
لا تُشترط خبرة سابقة. MLOps Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «حفظ نموذج في Bento Store»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس MLOps Academy هذا؟
نعم. كل درس في MLOps Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- حفظ نموذج في Bento Store
- تحديد خدمة وواجهة برمجة التطبيقات الخاصة بها
- تمكين المعالجة الدفعية التكيفية
- بناء Bento وتحويله إلى حاوية